Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Create enemies in 2D side-scroller


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Johnell   Members   -  Reputation: 352

Like
0Likes
Like

Posted 24 March 2013 - 08:00 AM

What is the best way to create enemies in a tile based side-scroller game? I can think of 2 different ways. Either manually place enemies on the tilemap or random their position. 

 

If I random their position I have to check for collision. If I manually place them I can make sure they never collide with an object. What's the best way to do this?

 

I am using http://www.mapeditor.org/ to create my tilemap.



Sponsor:

#2 BeerNutts   Crossbones+   -  Reputation: 2985

Like
3Likes
Like

Posted 24 March 2013 - 09:02 AM

It really depends on the type of game you want to make, but, typically, the enemies are pre-set in the map.  So, you would simply put where the enemies are on the map, and go.

 

If you want to randomize, which may be a viable option, yes, you'd have to check:

1) there's a place for the enemies to stand (ie, not a hole the enemy would just fall into, unless they fly).

2) there's no object or enemy already there

 

Good luck.


My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)

#3 Ludus   Members   -  Reputation: 970

Like
4Likes
Like

Posted 24 March 2013 - 11:19 AM

If you do want random enemy placement then the best option would be to have a list of predefined locations that would be selected from randomly. This way you can avoid having enemies spawn in weird locations.



#4 rancineb   Members   -  Reputation: 359

Like
1Likes
Like

Posted 24 March 2013 - 04:12 PM

You can do a hybrid where you have set areas where you want an enemy to show up, but make the location random.  Enemy placement, imo, is a big factor when it comes to level design.  You don't want complete randomness.  This way, you can have your enemies located in a certain area based on how you build your level, but the exact location will be random to make each play through a little different.



#5 Crusable   Members   -  Reputation: 594

Like
1Likes
Like

Posted 24 March 2013 - 09:53 PM

Also,  you could do a "Gauntlet, Dark Legacy" style where there are spawners that you can destroy. As long as the spawner is alive and you are near it, then enemies will spawn. 






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS