|
Post by differentialgiraffe on Jul 9, 2024 11:04:42 GMT
Hello. I think I found an issue where I can't jump on enemies and explode them. Though Sprite 2 is actually the spinning sprite. If the player had IMAGE = 2, and if it's in air, it will jump on the enemy and give 100 score, and if its spinning on the ground, the player will not jump but will score 100 points and will explode the enemy.
|
|
mas
Endorian Forest
![*](//storage.proboards.com/forum/images/stars/star.png) ![*](//storage.proboards.com/forum/images/stars/star.png)
Posts: 60
|
Post by mas on Jul 9, 2024 13:57:24 GMT
I think it will be down to where you're detecting the collision.
Assuming it is in the PLAYER event - I would expect something like this:
;; assuming enemy sprite to be sprite type 2
IF COLLISION 2 ;; check if player is a ball or not IF IMAGE = 2 ; image 2 is your spinning ball OTHER REMOVE ENDSPRITE SCORE 100 EXIT ; stop processing this event ENDIF
;; otherwise player is not a ball and dead
KILL
ENDIF
What it looks like is happening is the collision event goes "did I hit a player, player should be dead" before anything else is triggering. If you put your "collision events" in one place this will help avoid that - ie. either the player checks, or the baddies check; when they both check, strange and unpredictable things can happen.
|
|
|
Post by differentialgiraffe on Jul 9, 2024 14:27:00 GMT
Thanks!
|
|
|
Post by differentialgiraffe on Jul 9, 2024 14:40:08 GMT
I think it will be down to where you're detecting the collision. Assuming it is in the PLAYER event - I would expect something like this: ;; assuming enemy sprite to be sprite type 2 IF COLLISION 2 ;; check if player is a ball or not IF IMAGE = 2 ; image 2 is your spinning ball OTHER REMOVE ENDSPRITE SCORE 100 EXIT ; stop processing this event ENDIF ;; otherwise player is not a ball and dead KILL ENDIF What it looks like is happening is the collision event goes "did I hit a player, player should be dead" before anything else is triggering. If you put your "collision events" in one place this will help avoid that - ie. either the player checks, or the baddies check; when they both check, strange and unpredictable things can happen. I also like to know of the player is a FRAME = 0 when it stops moving. But I applied AIRBORNE so it should be like this
IF AIRBORNE = 0 IF DIRECTION = RIGHT LET IMAGE = 0 LET FRAME = 0 ENDIF IF DIRECTION = LEFT LET IMAGE = 1 LET FRAME = 0 ENDIF ENDIF The player will set its frame to its walking frame when if you stop moving.
|
|