Game Development Community

Create enemies in side scroller shooter games

by Daniel Jami · in Torque Game Builder · 08/04/2007 (3:19 am) · 2 replies

Hi
i work on a side scroller shooter game .
i set the camera movement with 2 codes :

sceneWindow2D.mount($pShip, 0, 0, 4, true);
sceneWindow2D.setViewLimitOn("-400 -450 400 450");

and move the tiles backword . this works OK .

my problem is with load enemy ships . i want to create some enemy ships in different places . how can i tell tgb to create these enemies . one solution is used trigger but think there is a beter way . any idea ??

tnx

#1
08/04/2007 (5:47 pm)
It all depends onn what you wanna achieve...

TGB its event driven, so i guess triggers its the way to go, so that, when a trigger its hit, you simply call the "Spawn" function for the enemies, and place them offscreen, in a random position (you determine that in the spawn function), so that they appear offscreen, and moves onscreen in no time.

why do i say triggers its the way t go?... because, if you populate the schedule queue with "spawn" funtions, you will lose control of the game in no time... and if you happen to have a level boss or something, it gets even worse!...

now, the trick here is, placing triggers in clever positions, responding to certain events (like, say, certain trigger wont appear, and so, wont get hit unless certain other trigger has been hit b4...), so that you are "in control" of certain events, and so, of certain triggers.

hope it helps... if its not clear, lemme know what you dont understand, i might try to clarify.
#2
08/05/2007 (2:43 pm)
Yes this helped ! tnx u .
I want to use triggers ...