Welcome, Guest. Please Login or Register.  • Help
SMF Underground
+ SHMUP-DEV » SHMUP DEV FORUMS » Assistance
|-+ timed launching

Pages: [1]   Go Down
0 Members and 1 Guest are viewing this topic. Topic Tools  
Read December 30, 2005, 05:11:52 PM #0
paladin

timed launching

as we all know, shmups like galaga or space invaders introduce enemies in waves that are launched after the previous wave has been completed.  it's the others that i'm asking about, the shmups where the enemy ships/whatever scroll by, never to be seen again.  i haven't gotten to this stage in development yet and was wondering if i could get some input on my idea: would it be a good idea to start a counter in the beginning of the game and work off that counter for launching ships?  this i can handle, i was just wondering if this would be a feasable way to handle it.  i can't really think of any other way Smiley


needs more particles...
Offline  
Read December 30, 2005, 05:22:52 PM #1
Matt McFarland

Re: timed launching

hmm I would do something like get the millisecs on the computer and say timer = millisecs() + 10000(10 seconds) then I would turn around and go "if millisecs() > timer" - that's exactly how I would do it in my game (in fact I'll probably have things like this later on)

I do not go by counters unless they are controlled by real time.  That ensures the game will play the same on every computer.


<a href="http://www.mattmcfarland.com/flash/myFlashSig.swf" target="_blank">http://www.mattmcfarland.com/flash/myFlashSig.swf</a>
Offline  
Read December 30, 2005, 05:24:56 PM #2
paladin

Re: timed launching

like i said in my post i'm running my game in delta time, so everything that "matters" is multiplied by delta.


needs more particles...
Offline  
Read December 30, 2005, 08:24:07 PM #3
Olofson

Re: timed launching

In my old (university programming project) sidescroller Project Spitfire (DOS, 16 bit PM, Pascal + asm), I simply had the scroll position trigger the enemies. That is, I basically placed the enemies on the map and had them wake up just before they became visible.

Note that this was a fixed speed scroller - but as opposed to the time based method, position triggered enemies work with push scrolling too.

Also note that the map was interactive (you could crash into certain tiles), and all sprite positions were relative to the map, rather than the screen. Obviously, the background scroll position wouldn't be of much use for triggering attack waves otherwise. :-)


//David
Offline  
Read December 30, 2005, 11:51:43 PM #4
Taiphoz

Re: timed launching

What I would do, is create a Timer that operates appart from the raw game timing, if your using Delta, or tweaning or some other system then if your shooter take 10 seconds to fly from the start to the end, then no matter what system your running on be it fast or slow, it should take the exact same time from start to finsih.

If your using delta and you end up getting to the end fast on some machines then something is wrong.

As the above conditions should be true , just create a new timer, to watch and manage your ship launches. and just have them launch on x number of seconds after the level is started.

should provide you with an easy to manage and update system for launching you enemies. just make sure you dont end up with a screen full of bad guys, if your first set of guys have not been killed i would suggest thant you have them either fly at the player to force him to move, or just have them fly out of the screen.


Offline  
Read January 02, 2006, 08:20:35 AM #5
TheColonial

Re: timed launching

The idea of a world timer is always a good one. There's plenty of good articles out there on timers, so if you're looking for resources then check out this article at Gamedev.

Stick with a world timer IMHO. At least then you have a reference point to a known central time wherever you are in your code.  It's a good way of keeping things in sync, and allows you to have all the timer stuff to be done in a single spot instead of scattered throughout your code.

Good luck!
TC.


In order to understand recursion, one must first understand recursion.
Offline  
Read January 02, 2006, 11:07:59 PM #6
2dguy

Re: timed launching

Even if you have a blank background, (no bitmap) just stars, etc, it's STILL good to think you're scrolling through a virtual world so you could simply havce a vertical counter variable that gets incremented in a consistant method, delta, timer, etc. And then simply in your code trigger things based on the value of the counter. Ez...  Wink
Offline  
Read January 03, 2006, 12:32:26 AM #7
Olofson

Re: timed launching

Well, as long as you're scrolling constantly, at a fixed speed, and you're doing everything correctly, you may call that counter "position" or "time" or whatever - they are the same thing expressed in different units. Wink

However, in a game with a mapped background of some sort, I still think it makes more sense to think in terms of position.

And what if you deal in time, and then decide to add this "scroll stop" powerup found in some games...? (I remember Sidewinder on the Amiga had an icon that stopped the scrolling for a while if you picked it up.)


//David
Offline  
Pages: [1]   Go Up
Jump to:  

Page created in 0.112 seconds with 18 queries.