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.

Newcomers AppGameKit Corner / [QUESTION] setting enemy type via Array

Author
Message
Stupinator
9
Years of Service
User Offline
Joined: 14th Sep 2015
Location: Vancouver, WA, USA
Posted: 14th Sep 2015 23:20
So here's the dealio: I'm making a game that's a 2d topdown shooter, without boundaries. It's going to have multiple enemy types, with different movements, damage, shot intervals, etc. which I will define using types. Here's where I need help.

I have the types thing down. I need to incorporate an easy way to create waves, using a simple format, possibly using arrays, possibly using a separate .txt file.

format would be enemytype(basically an integer) followed by an integer representing the amount of time before spawning the next enemy.

I would love to use a separate file for this, just to make things prettier, but arrays would probably be simpler. I'd like it to be a single array if an array is used, but two would probably make it even simpler.

Having difficulty determining the best way to parse these two options. Could be simple for loops for the array option, but no real idea how to manage a separate text file.

Any thoughts?

-Stupinator
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th Sep 2015 11:01
I posted an idea for the data structure in your other thread.
Take a look in the recent newsletters for my tutorial on creating and importing parameters from files (may 3 or 4 months ago). You could drop this code straight into your project to read your data in.

Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Stupinator
9
Years of Service
User Offline
Joined: 14th Sep 2015
Location: Vancouver, WA, USA
Posted: 15th Sep 2015 16:15
Love it. Feel free to delete this thread though, didn't intend to create two.

-Stupinator

Login to post a reply

Server time is: 2024-11-21 15:07:51
Your offset time is: 2024-11-21 15:07:51