LoginLogin

SPHITSP problem

Root / Programming Questions / [.]

UndergroundClayCreated:
I'm having a problem with my game with SPHITSP. I have SPCOL and the SPHITSP right but it won't work. I was wondering if one you were willing to download my game real quick and help me find the problem.
 IF ANSWER==TRUE THEN 
 ? "Thank You!"
 ENDIF

Er, I don't know what to download?
Unidentified variable error in 844:1
OK

I'll send it to you in a private message if you're up to it.

Ok. I think I know the problem: Code structure. You call @SPRITES, and it checks collision ONLY when the line is being run, not continuously. You need to move the collision code into the loops somewhere (maybe make an @collision) and put the IF SPHITSP code there. The code itself looks fine. EDIT: The pick disappears before it can detect collision, so it will not work. You would have to put the collision check into the axe code. Also, the axe code is REALLY messy.

Ah, ok. How would I be able to fix the axe? EDIT: I guess WAIT stops everything then xP

WAIT isn't the problem, although it is usually not a good idea. To fix the axe, separate your collision IF into a separate label, like @COLLISION, and after displaying the axe, right after the IF, you can call the label. It worked when I tried it.

So type...
@COLLISION
(all of the axe code here)
(Rock SPHITSP)
RETURN

Right?

What I used:
@COLLISION
(IF SPHITSP stuff)
RETURN 
And just insert a GOSUB @COLLISION after all WAIT 20s What it does is check for collisions, just before removing the axe. That way both sprites are there for it to compare with.

Oooooh so after the Waits, do GOSUB @COLLISION. lemmie try it

FINALLY THANK YOU SO MUCH! Now, one more question, is there any way I can duplicate a sprite having the same sprite collision as the first one without making another SPSET?

FINALLY THANK YOU SO MUCH! Now, one more question, is there any way I can duplicate a sprite having the same sprite collision as the first one without making another SPSET?
You need two sprites, so you will need another SPSET. And SPCOL etc. You should look into a FOR loop for some of your code.

How does FOR work? Isnt WHEN the same thing or no? Btw can I respawn the rock somehow?

FOR (Variable to count with)=(Number to start on) TO (Number to end on)

I see, thanks!