Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Awaking!
#1
The forum is practically sleeping. Death dance! Something needs to awaking things up – maybe this? Wannabe race car drivers at the Nürburgring.  Tongue

Reply
#2
Zoom zoom zoom.   - Mazda

It is good to dream commercials.  Esp. things that had Wankel engines.
Reply
#3
zoom crash shake it off, zoom crash shake it off, ...

Code: (Select All)
_Title "Bump N Go Car" 'b+ 2022-03-01
' b+ mod of Drive Car (Graphics Dir) 'b+ 2021-09-29

Screen 12
Type car
    As Single x, y, w, h, ra, speed
    As _Unsigned Long c
End Type

Dim blue As car
blue.x = _Width / 2: blue.y = _Height / 2
blue.w = 20: blue.h = 40
blue.ra = _Pi / 2: blue.speed = 2
blue.c = 9

While _KeyDown(27) = 0
    If blue.speed = 0 Then
        blue.ra = _Atan2(blue.y - _Height / 2, blue.x - _Width / 2) + _Pi + Rnd * -.5
        blue.speed = .1
    End If
    blue.speed = blue.speed + .5
    Cls
    blue.x = blue.x + blue.speed * Cos(blue.ra)
    blue.y = blue.y + blue.speed * Sin(blue.ra)
    If blue.x < 30 Or blue.x > _Width - 30 Then blue.speed = 0
    If blue.y < 30 Or blue.y > _Height - 30 Then blue.speed = 0
    drawCar blue
    _Display ' stop flicker
    _Limit 30 ' loops per sec
Wend

Sub drawCar (a As car)
    ' code not optimized for speed  just proff of concept
    X1 = a.x + a.h / 2 * Cos(a.ra)
    Y1 = a.y + a.h / 2 * Sin(a.ra)
    X2 = X1 + a.w / 2 * Cos(a.ra + _Pi / 2)
    Y2 = Y1 + a.w / 2 * Sin(a.ra + _Pi / 2)
    X3 = X1 + a.w / 2 * Cos(a.ra - _Pi / 2)
    Y3 = Y1 + a.w / 2 * Sin(a.ra - _Pi / 2)

    x4 = a.x + a.h / 2 * Cos(a.ra - _Pi)
    y4 = a.y + a.h / 2 * Sin(a.ra - _Pi)
    x5 = x4 + a.w / 2 * Cos(a.ra + _Pi / 2)
    y5 = y4 + a.w / 2 * Sin(a.ra + _Pi / 2)
    x6 = x4 + a.w / 2 * Cos(a.ra - _Pi / 2)
    y6 = y4 + a.w / 2 * Sin(a.ra - _Pi / 2)

    Line (X2, Y2)-(X3, Y3), a.c
    Line (X3, Y3)-(x6, y6), a.c
    Line (x6, y6)-(x5, y5), a.c
    Line (x5, y5)-(X2, Y2), a.c
    Paint (a.x, a.y), a.c, a.c
    Line (X2, Y2)-(X3, Y3), 15 ' give car a front

    ' white top  for all cars for future numbers maybe
    X1 = a.x + a.h / 4 * Cos(a.ra)
    Y1 = a.y + a.h / 4 * Sin(a.ra)
    X2 = X1 + (a.w / 2 - 3) * Cos(a.ra + _Pi / 2)
    Y2 = Y1 + (a.w / 2 - 3) * Sin(a.ra + _Pi / 2)
    X3 = X1 + (a.w / 2 - 3) * Cos(a.ra - _Pi / 2)
    Y3 = Y1 + (a.w / 2 - 3) * Sin(a.ra - _Pi / 2)

    x4 = a.x + a.h / 4 * Cos(a.ra - _Pi)
    y4 = a.y + a.h / 4 * Sin(a.ra - _Pi)
    x5 = x4 + (a.w / 2 - 3) * Cos(a.ra + _Pi / 2)
    y5 = y4 + (a.w / 2 - 3) * Sin(a.ra + _Pi / 2)
    x6 = x4 + (a.w / 2 - 3) * Cos(a.ra - _Pi / 2)
    y6 = y4 + (a.w / 2 - 3) * Sin(a.ra - _Pi / 2)

    Line (X2, Y2)-(X3, Y3), 15
    Line (X3, Y3)-(x6, y6), 15
    Line (x6, y6)-(x5, y5), 15
    Line (x5, y5)-(X2, Y2), 15
    Paint (a.x, a.y), 15, 15
End Sub
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply
#4
I understand.  You code Tesla and Waymo self-driving systems.
Reply
#5
Sorry just been too busy. Plus my computer blew up and I'm still picking up the pieces.
We'll be back as soon as things settle down and I've got a working PC. 
Until then, happy holidays!
Reply
#6
@video

try doing that with an audi 5000 from the 1980's.

there are some people (like me) eagerly awaiting the next qb64pe release.  otherwise have to post.  an awful lot of "off topic" stuff.  but don't want to.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)