Question about projectiles
#1
Posted 08 April 2017 - 05:15 PM
#2
Posted 08 April 2017 - 05:38 PM
..Ignorance is to be unaware of the truth.
....Incompetence is to be unable to grasp the truth.
......And escape is to run away from the truth.
It is useless to run, since the truth is right next to you.
-Wervyn
#3
Posted 08 April 2017 - 09:12 PM
There's also just using the 'if c?? Sprite p?? # #' method, but it fails to respect individual sprite collision settings so if you are using these, best to go with the above method.
Oh, and I've also got a tutorial of sorts about projectile engines, although it's less recent. Also, it uses a linked list, which is a really awful thing to do.

<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
#4
Posted 10 April 2017 - 04:01 AM
#5
Posted 10 April 2017 - 03:09 PM
#6
Posted 10 April 2017 - 07:24 PM
This post has been edited by Verasev: 10 April 2017 - 08:06 PM
#7
Posted 10 April 2017 - 08:02 PM
CJA, on 11 April 2017 - 01:09 AM, said:
It's unnecessary though. You can use it to check for collisions as long as the sprite has been put somewhere, no matter where that is. So you can put it at 32767,32767 if you want.

<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
#8
Posted 10 April 2017 - 08:12 PM
Attached File(s)
-
TestProject1.zip (26.56K)
Number of downloads: 2
#9
Posted 11 April 2017 - 02:47 AM
Second, in your #drawbullets subroutine, you're doing this:
copy block at "#&spr_pb_x&" "#&spr_pb_y&" for "spr_pb_w" by "spr_pb_h" to "#('lyr_pb_x'+'pbullets&loopcount&_x')" "#('lyr_pb_y'+'pbullets&loopcount&_y')"However, the sprite references you're using for your bullet art are actually on the board, you never did anything to put them on the vlayer. So instead you want this:
copy block at "spr_pb_x" "spr_pb_y" for "spr_pb_w" by "spr_pb_h" to "#('lyr_pb_x'+'pbullets&loopcount&_x')" "#('lyr_pb_y'+'pbullets&loopcount&_y')"Finally, your attempt to copy the overlay to the vlayer to clear the bullets for redrawing won't work, once you make the first two changes you'll find that nothing ever gets erased. This is because copying with the overlay treats character 32 as a transparent mask, to leave whatever currently exists on the target alone. This is why I had you make a blank.mzm, which I see you've done in the global. So instead of doing this:
copy overlay block at 0 0 for 80 0 to "#0" "#0"
Replace that with this:
put "@blank.mzm" Image_file p02 at "#&lyr_pb_x&" "#&lyr_pb_y&"
All of the bullet art is drawn facing the same direction right now, so I'll let you sort out how to reference the correct directional art yourself for now unless you need some further help with that.
..Ignorance is to be unaware of the truth.
....Incompetence is to be unable to grasp the truth.
......And escape is to run away from the truth.
It is useless to run, since the truth is right next to you.
-Wervyn
#10
Posted 11 April 2017 - 01:36 PM
#11
Posted 11 April 2017 - 01:58 PM
"Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you’re a mile away and you have their shoes."
-Jack Handey

Help









