Skip to main content
Alex_roo
Participant
August 9, 2015
Question

Creating a Side Scroller game

  • August 9, 2015
  • 1 reply
  • 2395 views

Hi All,

This is just a personal project as I want to learn how to create side scroller games fro IOS and Android.

I am pretty much brand new to AS3, I have used flash in the past to create simple banner adverts but not for a game.

I have found a pretty good tutorial on creating a side scrolling game like 'Flappy Bird' and I know with some tweaks I can change it so it doesn't resemble it.

The tutorial how ever does not show how to randomly generate obstacles, it only shows how to keep telling the certain obstacles to go back to a certain point on the 'x' axis.

I would like to create 5 obstacles and have them randomly be placed on the 'Y' axis and then move across the screen so the user has to dodge between them by clicking/tapping on screen.

Any help or another link to a tutorial would be much appreciated.

Thanks fro the help.

Alex

1 reply

Ned Murphy
Legend
August 9, 2015

What aspect of what you want to do are you having difficulty with?

Alex_roo
Alex_rooAuthor
Participant
August 9, 2015

‌I want to create 5 obstacles that randomlay generate at different points of the y axis. I then want these obstaclues to move from right to left of the screen that have to be dodged. I don't know where to start with creating any of the effect described.

any tutorial you might know of would be a great help. Or any tutorial explaining the whole flappy bird build.

cheers

Ned Murphy
Legend
August 9, 2015

Your best bet will be to tackle one aspect of it at a time - first look into how to add objects dynamically.  The basics of that are to create an object that you store in the library and assign it a class ID via its Properties option (left click it in the library for that option).  Then when you want to add a new instance of it you can use...

     var newThing:ClassIDYouAssigned = new ClassIDYouAssigned();

     addChild(newThing);

You can assign its x and y properties before adding it as a child.

newThing.x = someValue;

newThing.y = .... // look into using the Math.random() method to randomly assign it a y location

You can always wait to see if someone comes along and does your work for you - some people will.