Self Generating Map Help
cBrooks
Member, PRO Posts: 40
Hello guys! I am planning on making a game where you are a car in a zombie infested city and you have to escape. It is 2D and all the controls are is drop a bomb and shoot zombies behind you and jump over upcoming objects. I want the road to keep on generating more road and obstacles by random so the player can get as far as possible and I would also like it to get a bit harder the further you progress into the game. Thanks! (I'm not very experienced so please explain in simplicity) Here is a little thing to show you the layout: c=car _____=road o=obstacle z=zombie ^=where you're meant to jump.
______z___z__z________c___________^o_________^oo____________^o______________^oo_____
______z___z__z________c___________^o_________^oo____________^o______________^oo_____
Comments
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
For the scrolling background you can make a road tile image (once again this can be very basic art for now) a bit wider than the width of the screen. Make it move from right to left and then disappear after it leaves the screen. Keeping spawning the same road tile every few seconds so they slightly overlap and make the impression of a continous scrolling road. Alternatively you could have a still road and make a dashed center line in the same 'spawn, move, destroy' loop. Though if you have any detail on the road (potholes, rocks etc) the whole road will need to scroll to look right.
For the character jumping you just need to make sure they 'collide' with the road (or with an invisible hit box on the road) so they don't fall through the road and off the screen. Then set up a rule so that if you touch the screen or a jump button, the character accelerates at 90 degrees (up) and then after releasing the button or after a set time they would accelerate to 270 degrees (down). If the collisions are set up correctly the character should land back on the road and stop decelerating.
Have a go at this and then you can add more elements/mechanics as you go to your game like obstacles, animations, life bar, weapons, etc. Good luck!
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS