The Daily Click ::. Forums ::. Klik Coding Help ::. fastloop trouble
 

Post Reply  Post Oekaki 
 

Posted By Message

spliffy



Registered
  18/11/2006
Points
  22
7th December, 2007 at 19:06:42 -

loop trigger #0
+ bullet overlaps enemy

destroy bullet, destroy enemy



the bullet just passes through and destroyes all enemies if theyre in a line

how does spliffy solve this problem?

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
7th December, 2007 at 20:09:11 -

Do you need a fastloop here? are your bullets SO fast they pass through stuff?
if not then just take out the loop.

 
.

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
8th December, 2007 at 04:27:42 -

I think I remember having the same problem once with MMF2. Fastloops and overlaps/collisions just refused to work logically.

I don't remember how I worked around it, but maybe try moving the actions out of the loop?

loop trigger #0
+ flag 0 of bullet is off
+ bullet overlaps enemy
--bullet: set flag 0 on
--enemy: set flag 0 on

flag 0 of bullet is on
--bullet: destroy

flag 0 of enemy is on
--enemy: destroy

That's just a guess based on a suspicion that the bug is due to the way collisions are handled.


Edit: wait, that probably wouldn't work.
Instead, assuming your bullet movement is handled in a loop, try stopping the bullet so that it doesn't hit any enemies in the time it takes for the collision or whatever to resolve.

So

loop trigger #0
+bullet is facing direction 0
--bullet: set x position to x(bullet)+1

would become

loop trigger #0
+bullet is facing direction 0
+negated(bullet is overlapping enemy)
--bullet: set x position to x(bullet)+1

while your collision code is the same as you originally posted.

Worth a try, anyway.

Image Edited by the Author.

 
n/a

spliffy



Registered
  18/11/2006
Points
  22
8th December, 2007 at 05:55:20 -

doesnt work x( thx anyway
im only 20 events into my game so ill just rewrite it all

 
n/a

spliffy



Registered
  18/11/2006
Points
  22
8th December, 2007 at 08:30:19 -

works with

-only one action when event loops



 
n/a
   

Post Reply



 



Advertisement

Worth A Click