Should check for each red object colliding with the floor, and making it stop. And it does, but only for the least created object.
For instance, if i rapidly click twice, the first object stand still, while the 2nd one falls and stop then collides with the obstacle
Also, them seem to fall faster as the number of objects increase
Thank you guys, you solved my problem. The thing is that i am used to use the built-in fastloop but i'm trying out the extension coz i've seen it on a tutorial
But you think the built-in loop is better? Why?
n/a
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
19th February, 2010 at 04:21:59 -
The built in fast-loop is better simply because it is built in. I don't think speed differences would be noticeable but it's a good idea to not use an extension for a function that is built in. MMF's loops are also named which is a lot more useful for debugging and general usability than numbered loops.
Like Sketchy said, the fastloop extension is now obsolete because it is now built into MMF's core.
I have multiple detectors, like lines of sight
For testing purpose, i wanted them to change from orange to purple (just changing animation direction) when the player were overlapping them
But if i keep on overlaping any of them, they all turn purple as i collide with them, and all get orange at once if i stop overlapping any
Images to explain better: ^^
On loop "spread1"-
-Set direction of "Detector" to 0
On loop "spread1" and "Player" is overlapping "Detector" and Alterable Value B of "Detector" is equal to LoopIndex("spread1")
-Set direction of "Detector" to 8
You don't need a fastloop for that.
The problem is that you need to check for the detectors overlapping the player, not the player overlapping the detectors.
It's as simple as this:
+ Always
-> Detector: Set direction to RIGHT
+ Detector is overlapping Player
-> Detector: Set direction to UP
Also, I think you'll save yourself some trouble later on if you use maths rather than detectors (ie. Calculate the distance from the player using Pythagoras' theorum). Matching objects and detectors can be a pain, and is best avoided where possible (embedded detectors are great too - there's an article on it somewhere).
When i try to destroy an enemy, all of them are destroyed at once
This is the code:
The Alterable Value J of the sprite and the spreadValue variable of the enemy are the variables that I use to store the spread values, and they work just fine
It's the order of conditions again - just swap them round and it'll work.
The way you have it, it works like this:
If Alterable Value J of the most recently created Hedgehog(?) is equal to Spread Value of the most recently created RedBox...
...and HP of the most recently created RedBox is less than or equal to 0...
...then destroy all Hedgehogs and destroy all RedBoxes.
If you put "HP of RedBox <= 0" at the top of the list, it works like this:
Select each RedBox whose HP is less than or equal to 0...
...and select each Hedgehog whose Alterable Value J is equal to the SpreadValue of one of the selected RedBoxes...
...then destroy each selected Hedgdehog and destroy each selected RedBox.
The code is somewhat messy
You can find the destroy event at Battle Events > Hit Detector Weak
Spread values at line 10 (with all groups closed)
And if you need, enemy sprite positioning is at Enemy Animation > Enemy - Kobold (even if that looks like a hedgehog, but its placeholder)
It's crazy complicated, and I don't speak Spanish, so I had some trouble understanding what was going on.
I must admit, I don't know what's wrong with the way you did it, but I do have a work-around which fixes the problem:
+ HP of enemy1 <= 0
+ Pick one of spr_enemy1
-> Destroy enemy1
-> Destroy spr_enemy1
It doesn't actually matter which sprite is destroyed - whichever ones are left over will be properly matched up again the very next frame anyway.
BTW: You don't need to spread a value on every loop of a fastloop. Just do it once before starting the loop. Better still, only do it when you create or destroy an object.