
-----------------------------------
TheOneTrueGod
Wed Apr 12, 2006 7:17 pm

Walking &quot;Algorithm&quot;
-----------------------------------
a/d moves, just a simple walking thingy I put together. It looks kinda cool if you have music in the background.


var counter : int := 0

var x, y : int := 100

var keys : array char of boolean

View.Set ('offscreenonly')

loop
    Input.KeyDown (keys)
    if keys ('d') then
        x += 1
        counter -= 10
    elsif keys ('a') then
        x -= 1
        counter += 10
    end if
    %counter -= 10
    counter mod= 360
    %Bottom Legs
    drawline (x + round (cosd (counter) * 5), y + 5, x + round (cosd (counter) * 10), max (y + round (sind (counter) * 15) - 10, y - 10), black)
    drawline (x + round (cosd (counter + 180) * 5), y + 5, x + round (cosd (counter + 180) * 10), max (y + round (sind (counter + 180) * 15) - 10, y - 10), black)
    %Middle Legs
    drawline (x + round (cosd (counter)), y + 10, x + round (cosd (counter) * 5), y + 5, black)
    drawline (x + round (cosd (counter)), y + 10, x + round (cosd (counter + 180) * 5), y + 5, black)
    %Torso
    drawline (x + round (cosd (counter)), y + 10, x + round (cosd (counter) * 2), y + 30, black)
    %Top Arm
    drawline (x + round (cosd (counter)), y + 25, x + round (cosd (counter + 10) * 8), y + 20 + round (sind (counter) * 2), black)
    drawline (x + round (cosd (counter)), y + 25, x + round (cosd (counter - 150) * 8), y + 20 + round (sind (counter + 180) * 2), black)
    %Bottom Arm
    drawline (x + round (cosd (counter) * 10) + 8, y + 20 + round (sind (counter) * 5), x + round (cosd (counter + 10) * 8), y + 20 + round (sind (counter) * 2), black)
    drawline (x + round (cosd (counter + 180) * 10) + 8, y + 20 + round (sind (counter + 180) * 5), x + round (cosd (counter - 150) * 8), y + 20 + round (sind (counter + 180) * 2), black)
    %Head
    drawoval (x + round (cosd (counter) * 2), y + 30 + 8, 8, 8, black)

    View.Update
    Time.DelaySinceLast (30)
    cls
end loop


-----------------------------------
ZeroPaladn
Thu Apr 13, 2006 9:20 am


-----------------------------------
very neat.

+10 bits

-----------------------------------
MiX-MaztA-M8riX
Thu Apr 13, 2006 9:55 am


-----------------------------------
Heh, damn, pretty nice :P

-----------------------------------
NikG
Thu Apr 13, 2006 11:26 am


-----------------------------------
Very cool TheOneTrueGod.

Next step might be more movement control (i.e. punch, kick, jump) and you've got the beginning of a stick fighter.

+10 bits

Edit: It IS cooler with music.  haha

-----------------------------------
blaster009
Mon Apr 17, 2006 2:35 pm


-----------------------------------
Lol, love it.
