|
Post by bobby2guns2003 on Mar 21, 2004 11:50:09 GMT -5
ok you know when your updating x,y over mplay wirte and read stuff. i was thinking to have an object read the y,x cords then do this if myPlayer.y -=1 { sprite_index = up }
!would this work?! I would like it to do it to all the mplayer.objects in the game.
|
|
|
Post by IsmAvatar on Mar 21, 2004 13:09:37 GMT -5
no, that wouldn't work I don't think. What that's saying is, since y -= 1 is the same as y = y - 1 if y = y - 1 Then we can solve mathematically, subtract y from both sides: 0 = -1 always false So it would either return always false or would give an error, depending on how exactly GM handles it. There is a variable called yprevious if y < yprevious
|
|
|
Post by Gabrias on Mar 25, 2004 19:02:06 GMT -5
you just have to update the speed and direction, then each object discover what sprite to use by reading each own direction:
if (direction = 0) sprite_index = right; .....
and so on
|
|