Logic of Player movement

Blitz3D Forums/Blitz3D Beginners Area/Logic of Player movement

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Alternatively (and if you still want to use seperate animation sequences) you could try this...


Dim hero[5]

global hero[1]=LoadAnimImage("standing.png",8,10,10,10)
global hero[2]=LoadAnimImage("walking.png",10,10,10,10)
global hero[3]=LoadAnimImage("shooting.png",10,10,10,10)

global hero_idx=1;

While Not KeyHit(1)

    If( KeyDown(205) ) Then
        hero_idx = 2;
    Else
        hero_idx = 1;
    End If
 

    PositionSprite(hero[hero_idx], x, y) ; Your sprite function etc...

Wend


Well, you get the basic idea...