Public Group

# Top Down Shooters

This topic is 3642 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi all are there any tutorials that you guys could direct me too that show how to accomplish some of the key things behind top down shooters 1.e scrolling background, how to place enemies on the map that the player does not see until they reach that area things like that. I am taking a 2d game engine class in college so I am not a complete beginner and I really just want to create a one level simple top down shooter with spaceships and stationary enemies( no AI). Its not going to be complex I know how to do everything else that is needed for the game so I just need help with the scrolling( should be continuously scrolling like a normal top down space shooter) and how to place enemies farther in the map. On the last one I had a theory that perhaps they dont place enemies on the map but that they randomly generate them: like as you proceed all of sudden an enemy is loaded in front of you however to the player it looks as if it had always been there. Ok thats all any insight and/or direction on this subject is greatly appreciated. Oh and I am programming in C++ and using DirectX 9 THanks!

##### Share on other sites
I saw your post earlier today and while I can't think of any tutorials (most likely because I don't read them), I can cover all the necessary aspects. The problem that occurred to me was the breadth of topics that I would need to cover, which made me reluctant to get started. I considered adding a page to the wiki instead, but then I got distracted by the day's tasks.

Later this evening I will put together a guide to single-dimension scrolling, covering tile-based backgrounds, procedural backgrounds, maps, static and randomized object placement and other topics. I'll keep this tab open in my browser as a reminder.

Perhaps someone else will respond with a tutorial or article in the interim, though.

##### Share on other sites
Quote:
 Original post by OluseyiI saw your post earlier today and while I can't think of any tutorials (most likely because I don't read them), I can cover all the necessary aspects. The problem that occurred to me was the breadth of topics that I would need to cover, which made me reluctant to get started. I considered adding a page to the wiki instead, but then I got distracted by the day's tasks.Later this evening I will put together a guide to single-dimension scrolling, covering tile-based backgrounds, procedural backgrounds, maps, static and randomized object placement and other topics. I'll keep this tab open in my browser as a reminder.Perhaps someone else will respond with a tutorial or article in the interim, though.

Thank you Oluseyi I look forward to reading what you will put together.

Thanks!

##### Share on other sites
As another option, get your hands on Beginning Game Programming, its a Thomson series book by Jonathan S Harbour.

If your not interested in going to the 3d step the first half of the book is a good start for all things 2d... scrolling backgrounds arnt covered but its not that hard a leap from the code in the book.

##### Share on other sites
Quote:
 Original post by OluseyiI saw your post earlier today and while I can't think of any tutorials (most likely because I don't read them), I can cover all the necessary aspects. The problem that occurred to me was the breadth of topics that I would need to cover, which made me reluctant to get started. I considered adding a page to the wiki instead, but then I got distracted by the day's tasks.Later this evening I will put together a guide to single-dimension scrolling, covering tile-based backgrounds, procedural backgrounds, maps, static and randomized object placement and other topics. I'll keep this tab open in my browser as a reminder.Perhaps someone else will respond with a tutorial or article in the interim, though.

I'm sure your guide will probably cover all of the things I'm about to say, and I can't wait for it. I will just give a little insight, briefly.

For enemies, yes, they are generally loaded after you finish a "level" of enemies in the game, then they fly in. Really, you will probably want to write a generic file that describes how the enemies will show up. It doesn't have to be anything complicated, just a simple file to help you out. For example, you could create say 10 scenes will different fly-in's and different sprites. Then you could create a file like:

1 5 3 3 2 1 10 5

I think you get the point. At any rate this would allow for you to create an infinite game if you just kept generating numbers from 1-10 and feed it into your game engine.

I hope that helped you a little bit.

##### Share on other sites
I can't tell you how to do it in C++, as any similar games I've written were in BlitzBasic, but perhaps I can give some general game ideas.

Scrolling:

A scrolling background is usually created by either finding or creating a large image file that is seamless on both ends. that is able to be repeated over and over without the user noticing any lines.
If its scrolling from top to bottom. I generally create a background that is as wide as my screen is and then make it maybe twice the height, this gives more variation and gives the player less of a chance to notice features that stand out.
How to scroll it? In C++ I'm really not sure... In blitzbasic it was a simple task of decreasing the y-value at a certain rate every frame in the game, and having this repeat over and over. In C++ it's probably a bit more complicated.

Enemy Creation:

Generating enemies off map shouldn't be too hard, as you only have to place them at coordinates that don't exist on screen. Afterwards create an AI to start to home in on a player. Perhaps create a function that checks the player's X and Y position every few seconds and then self corrects. When it reaches a certain distance turn the homing function off and start whatever attack AI you'd like.
I'm not sure of the functions Direct X gives you so the rest from here is conjecture. If you want to load the enemy right in front of the player, but have the player think they were always there, I'd try some type of method of having randomly generated objects on screen.
If its a space shooter maybe asteroids, space debris, ship wrecks, space stations etc...
If its on land.... Hills, mountains, cities, fortresses, houses, buildings, etc...
If its in air floating fortresses and cities, large clouds, mountain peaks, etc...
Everytime one of these objects give that object say a 5 or 10% chance to carry an ambush variable. Where if that ambush variable is turned to 1, it spawns a hidden enemy that will suddenly appear from inside, or behind the object and attack the player. The player will think they've always been there hiding even though they've just been spawned.

Hopefully this has been of some help. Not familiar with your language, so I can only look at it from a more generalized perspective. Good luck.

##### Share on other sites
Took me a little longer to get around to it (couple things popped up yesterday evening), and it's still a work in progress, but here it is: Scrolling Games.

##### Share on other sites
Quote:
 Original post by OluseyiTook me a little longer to get around to it (couple things popped up yesterday evening), and it's still a work in progress, but here it is: Scrolling Games.

Wow thanks so much! I appreciate you taking the time to put that together it is most definitely helpful.

Thanks again

##### Share on other sites
Quote:
 Original post by OluseyiTook me a little longer to get around to it (couple things popped up yesterday evening), and it's still a work in progress, but here it is: Scrolling Games.

Wow, I wish I'd had that back in 2003. :) I think your math is off, though: you want tiles 96 pixels high if there are 5 rows making up a 480px-high viewport. :) You might also want to add a section about two-dimensional scroll.

For mobile games, I've had to implement a two-dimensional circular buffer (hrm, toroidal buffer?) for tiles that appear on the screen, to minimize blit calls (in J2ME, on typical devices, the overhead of calling the graphics API totally dominates the time taken to actually fill pixels - as far as my tests could tell, anyway). Is this kind of optimization relevant anywhere else (notwithstanding that it's a pessimization anywhere that it isn't relevant ;) )?

##### Share on other sites
Please, 2D scrolling, too! That's my next project...

• 11
• 20
• 12
• 10
• 38
• ### Forum Statistics

• Total Topics
631401
• Total Posts
2999864
×