mas
Processing Plant
Posts: 28
|
Post by mas on Sept 26, 2023 16:51:51 GMT
So I've been playing around with MPAGD and am working on some games that mix blocks and sprites. (Think a "Pang!" style game where you shoot a rope up to burst bubbles on contact). Using deadly blocks, the ball sprites can detect the collision with the rope and then spawn smaller versions and trigger a putblock routine to clear the rope blocks. However, when this happens you often end up with bits of sprite left behind on the background - I'm assuming an "OVER" type effect is happening and when the sprite is printing itself over the previous sprite prior to moving, part of the previous sprite has already been cleared - so instead it appears on the background (There should be a screenshot at the end showing what I mean.) Have people experienced this before? Is there a way to avoid this? The PUTBLOCK routine to clear the rope is occurring within the collision event in the sprite. Any advice? Thank you in advance Mas for ref: code I'm using to remove the rope looks like this: WHILE R <= T LET COLUMN = S LET LINE = T PUTBLOCK 0 SUBTRACT 1 FROM T ENDWHILE where R is top of the play area, T is the current Line (calculated previously and stored) and Block 0 is the standard empty block and S is a stored and calculated value for 'x' Attachments:
|
|
mas
Processing Plant
Posts: 28
|
Post by mas on Sept 26, 2023 23:59:30 GMT
So, I had a think about it and I have a "mostly working" solution
For the sprite that is being affected by the PUTBLOCK there needs to be a completely blank frame.
If you then switch to the blank frame before running the PUTBLOCK sequence, then there (appears) to be no bits of sprite left behind.
i.e.
IF DEADLY
FRAME 0 ; blank frame for the sprite REMOVE ; remove this instance of the sprite
; =================== ; remove rope
WHILE R <= T LET COLUMN = S LET LINE = T PUTBLOCK 0 SUBTRACT 1 FROM T ENDWHILE
ENDIF
|
|
|
Post by ramon on Sept 28, 2023 4:24:19 GMT
Don't put the string script in the same event as the other sprites
|
|
mas
Processing Plant
Posts: 28
|
Post by mas on Oct 11, 2023 16:53:19 GMT
Don't put the string script in the same event as the other sprites I think that makes sense; I've been doing a lot of meddling lately with getting and putting blocks and there is definitely something about the order that events occur that is affecting this. What I've done with other things is note the collision and set a variable that is then picked up by either of the main loops; which I might try with this. To be honest, this is all an exercise in me trying to do things "other than platform games" with MPAGD. If I get something reliable that works consistently, I'll share later.
|
|
|
Post by ramon on Oct 11, 2023 20:55:25 GMT
idea: think of the harpoon as responsible for creating and breaking the rope. in charge of erasing himself and erasing the rope. Think of the balloon as responsible for bouncing and dividing until the frame is so small that it can be annihilated. They are two different events. it could work. test it.
|
|
|
Post by ramon on Oct 11, 2023 21:00:18 GMT
The balloon is in charge of detecting the rope and dividing, then raises a flag so that the harpoon, in its turn, erases itself and its rope.
|
|
mas
Processing Plant
Posts: 28
|
Post by mas on Feb 12, 2024 13:23:55 GMT
Just a belated thank you. I will definitely come back to the PANG!-like game in the future, but following your advice I've gotten a better understanding of the timing of things, which is good, as I need that for a section in the game I'm currenly working on. :-)
My first couple of games have definitely been a learning exercise. Thanks for the advice.
M.
|
|
|
Post by pachic on Feb 18, 2024 0:22:27 GMT
well , the other thing is a putblock and check when no sprite there put again
|
|