Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

A few hard questions

Okay, well I'm building upon a shooter event system to make it into a mini game for my project. I have most of it made, where your protecting a castle fortress type thing by shooting arrows at the enemies.

The way this works is you control an aimer and just press enter on top of the enemies, in a top down battle field while they run toward the fortress. But I'm having trouble making the game know when the enemies reach the fortress doors, I don't want them to have a set move pattern though. It is supposed to maby either count how many made it into the castle, and then after that you fight them with the party inside the castle.


With all the help from different forums I got that part done, but now I have another question: Do I need to have a variable and common event for all 30 enemies?

The way I'm doing it is I have a variable for the enemy and the gate and a common event that checks if the enemy is at the gate. But I have 30 enemies that come in waves of ten, so I was thinking after I kill the enemy I could set its position back to the start of the battlefield until I trigger it to come back out for the next wave, but that doesn't work because when I shoot them they end up getting stuck in the middle of the screen and everything gets messed up.

This one is a little more confusing, I can still send the project to who ever wants it.
 
It's a tad complex, but you could do it with events by having a Parallel Process event tracking the X and Y of each sprite, and triggering a Conditional Branch when either or both reach a certain range, letting you increase a Variable or something.

Or did you need help with the movement plan for the enemies itself?
 
I thought of doing that but I would need to track the X and Y it with every enemy event wouldn't I?
Because I have maybe around 30 enemies coming in waves of ten. By the movements I meant I thought of setting a movement for each event then at the end of that , if they made it to the fortress then it would add to the variable, but I wanted it more random. I see that might be the only way to do it though.

Thanks for the reply!
 
I can basically promise you that checking 30 events at once will be a one-way bus ticket to Lag City. 

On the other hand, if you reuse the same 10 events three different times for the three waves, that might not be quite as bad.
 
Thanks for the reply! With all the help from different forums I got that part done, but now I have another question: Do I need to have a variable and common event for all 30 enemies?

The way I'm doing it is I have a variable for the enemy and the gate and a common event that checks if the enemy is at the gate. But I have 30 enemies that come in waves of ten, so I was thinking after I kill the enemy I could set its position back to the start of the battlefield until I trigger it to come back out for the next wave, but that doesn't work because when I shoot them they end up getting stuck in the middle of the screen and everything gets messed up.

This one is a little more confusing, I can still send the project to who ever wants it.
 
I think you'd need variables, for every enemy that's on the screen at once.  One common event should be enough, but please remember that a common event that's checking 60 conditional branches at once will produce a certain amount of lag.  (How much lag you'll tolerate is, of course, an individual choice.)

You can probably reuse 10 events for the different waves, however, which should be easier on your machine.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top