how do i make a hitbox for fighitng-game?
i wanna create a double-dragon game where u fight multiple enemies.
currently i use one active object as the enemy (and applied the enemyselection example to it found here: http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=180911#Post1809 11 thx LB!)
the problem is that i have several objects that are dependant on the enemy, like one squarebox-object at his left side, and one squarebox-object at his right side which determines the players position when he hits. but when i use several enemies they all die because the squares beside them affect everyones lives.
is there a way to test the distance between the enemy and his appointed square boxes so that they ONLY affect the enemy closest to them?
Re: how do i make a hitbox for fighitng-game?
It would probably be simpler to use a single hitbox on your enemy. It can be any shape, so there really is no reason to use more than one for the left/right sides. And to determine if the player is at the right height, just use a Y position check against the enemy. You could even do an X position check to control how far away you are from an enemy to hurt them.
If you only want to hurt one enemy at a time, just use the "Pick object at random" along with the overlapping condition. That will make MMF only hit one enemy (of that type) at a time.
Re: how do i make a hitbox for fighitng-game?
mobichan has a good idea. You can also try the Advanced Direction Object for distance.
Marv
Re: how do i make a hitbox for fighitng-game?
Fastloops.
At the start, spread a value over the enemies, then run this fastloop:
[Value of ENEMY = Loop Index] + [Detector is overlapping ENEMY] --> Set Value of Detector to Value of ENEMY
Then, just use fastloops to manage each one individually.
Re: how do i make a hitbox for fighitng-game?
thx for the tip ! got it working now
another quick question, how do i rezise objects ? like if i want an object to grow bigger in-game
Re: how do i make a hitbox for fighitng-game?
You can either set the scale of the object to a variable, then increase the variable over time. Or you could animate the scaling by changing the size of each frame by hand and then just play that animation.
Re: how do i make a hitbox for fighitng-game?
nice, thx !
instead of creating a new topic i wanted to keep asking questions in this one.
so here is another question:
how do i make the same kind of objects (like 2 cloned enemies) keep away from eachother? like if they collide they should walk away a bit from eachother or at least "glide" apart.