Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Creating More Enemies

Author
Message
vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 23rd Dec 2011 21:22 Edited at: 23rd Dec 2011 21:28
Hey !!

I got a struct for a type of enemy.

Now i want to make like 10 enemies of the same struct

I used:


Ok, the spd is the speed of the enemy.

This for loop in theory will load 10 enemies from the Enemy struct here it is:


Ok now in the game loop

I got the Update func that updates the enemy movement and all.

Definition:


And using:


It will get the Spawned enemies number and update them.


The problem here is that it's only creating 1 enemy but with his things multiplyed by 10.


here's the Path definition:



It will generate a random number and choose the path for that enemy...

Well... if you need any more code just say

If you know whats wrong please tell me

Thank you

C++ Medium 3.5/5
www.oryzhon.com <-- My company's website (W.I.P)
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 29th Dec 2011 03:10
You can use the same concept to generate enemies that I proposed with the bullets.

http://forum.thegamecreators.com/?m=forum_view&t=192871&b=22

The fastest code is the code never written.

Login to post a reply

Server time is: 2024-04-25 03:00:38
Your offset time is: 2024-04-25 03:00:38