I am currently making a game where one enemy has to be faster than normal ones. But when I type in Step Size in X/Y, it makes all of the enemies faster. How to I give enemies seperate traits? (Note that I used the Invader movement)
Printable View
I am currently making a game where one enemy has to be faster than normal ones. But when I type in Step Size in X/Y, it makes all of the enemies faster. How to I give enemies seperate traits? (Note that I used the Invader movement)
Sorry, but the invaders movement makes all enemies move the same speed. If you need a faster enemy, you will need to manually code it, which isn't super hard.
You can make different enemies.
If you are using duplicate enemies you can spread value and this will give each enemy an ID.
Marv
With the invaders movement it doesn't work that way, they all have the same speed. If you need proof, I have some ready.
Marv, I can confirm that the invaders movement speed is global to all objects and instances with the invaders movement. :(
I know that. I played invaders until my brains leaked out the door. I thought the kind sir wanted to set the speed different.
Marv
He wants different invaders to move at different speeds, Marv.
Bittergamer1886
Do you want to have different instances of the same type of enemy to be able to have different speeds?
Or do you want different types of enemies with different speeds?
You can't change the speed of just one object that uses invaders movement or use multiple instances of invader movement. You'll have to use a custom movement engine for the other objects. The invaders movement controller needs to be re-written so it can be used in multiple instances. At least that's what I came up with by testing.
Exactly! That's what happened in my testing, too! Bittergamer1886, I might be able to make an example for you.
I can make an example for you if that's what you want. It's more than one event, so it's kinda hard to put it in words on here. Generally, it's easier for me to make an example than say every line of code the example would use.
It doesn't work that way, it can't copy and paste code as text.
EDIT: Making the example could take a while for me, someone else might be able to help more. Also, my example requires the ForEach object so far, so you will need that for my example to work. The ForEach object is an overall helpful object when it comes to looping through every object.
The example I have made requires the ForEach object.
It has more than one event, meaning it would be tedious for me to put all the events/actions/expressions into words.
This only allows for two enemy types (one using the custom movement, one using the standard movement).
All the example has is the movement, not the game, so you will have to code the player, lasers, etc.
You can't do it in the demo version. The full version of MMF2 is needed to install extensions.
Do you really need one type of enemy to be faster? Be creative, find another way to make it something other than a clone of space invaders. If you do need it, then just wait for someone else to make an example. I could make you an example of how to create a game similar to an existing game without making it a clone. Just a simple example, but it will still be enough to give you the idea.
It is not a clone. On the left side of the screen, there is your player. He is on top of the wall which goes vertically all the way across the screen. Enemies come in in random patterns from the right, not a massive attack. I don't know how to make enemy movements, so I used invader for the enemies. If they accidentally spawn too far low and reach the right side of the screen, a green barrier will send them back (The wall does not go from edge to edge, but almost does). Otherwise, the wall sends them back, while removing some wall-health.
You could use the Bouncing ball movement. Just set the direction to make sure it moves in the right direction, and it will move towards the wall in a better way then invaders. I'll make an example (to demonstrate using bouncing ball as an enemy movement). ;)
EDIT: Oh, and if I had known that, then I wouldn't have used the ForEach object in the example, and would have made the example to help you better. The example I had made was for a copy of the invaders movement, not the movement type you seem to want.
EDIT 2: Here is the example: Attachment 6477