LoginLogin

help pls I'm stuck!

Root / Programming Questions / [.]

KomodoCreated:
how do i make a enemy's sprite and the player's sprite to move on the screen at the same time i'm lost?

Depends. You can use SPANIM once for both of them, use SPOFS repeatedly for each, idk, what's your code so far?

spanim won't work if you are moving the charecters with button commands i have been using spofs and spchr and the wait command to do the animation of the charecter, but then i try making a main loop that goes through all the stuff thats going on like this
@main
gosub@button
gosub@enemy
gosub@score 
btw i'm tring to make this as simple as possible because i'm helping a friend of mine and he is a begginer. but anways so i have the enemy move randomly while the charecter is doging them.

Spofs and splink, use both of em, or just use spanim and splink.

spanim won't work if you are moving the charecters with button commands i have been using spofs and spchr and the wait command to do the animation of the charecter
Where are you doing the wait command? (For starters, VSYNC is probably better....)

Spanim works, I've used it along with BREPEAT... SPANIM offset stuff (button repeats as animation finishes) SPANIM again EDIT: though, it works only so well, I use it for grid-based maps, but an 'all-over' type thing might not work for spanim.

It sounds like maybe you need to adjust your main loop. You shouldn't need to use WAIT as it will halt the rest of the program for the designated time.
@MAIN
  GOSUB @BUTTON
  GOSUB @ENEMY  ' don't use WAIT inside this function
  GOSUB @SCORE
  VSYNC    ' use this instead of WAIT
GOTO @MAIN
The WAIT code you mentioned, should really be a VSYNC, and it should happen at the end of the main loop. If you are inserting WAIT commands in the code that evaluates each sprite, you'll be pausing everything else in your program.