Skip to main content
Known Participant
February 28, 2013
Question

Please help me on my Android game

  • February 28, 2013
  • 7 replies
  • 1199 views

I am trying to develop a android runner game for school purposes.. I am still new to this and please I need your assistance..

You guys can view my CS5flash file at >>> http://www.filedropper.com/test_37

The obstacles and coins are on random. But the obstacles and coins are overlapping each other.. Which is very bad for a runner game because it looks very bad and the gameplay gets very very complicated.

How can i fix it??. Is there any way to fix it?.

And i am also thinking if I can set the obstacles and coins to a specific area (not on random). So the game will be more oganized and the gameplay won't be complicated. Which i still don't know -_-.

But i still prefer it on random. So guys please help me fix it..

This topic has been closed for replies.

7 replies

Inspiring
March 3, 2013

If I understand you correctly, what I would have done is simply is to store the last placed items x value, then when you place a new one, check the position the last one was placed and add the distance of your choice... like  

newItem.x=lastXPos.x+=whatever value here.. fixed or random...

you could also do it so if the last item was a coin, then the distance could be less, if it was a block, the distance could be further away...

pretty simple to pull off.

Known Participant
March 4, 2013

uhmmm where should i encode those codes?. Please see my CS5 flash file at http://www.filedropper.com/test_16

Please help the deadline is very near already . for school purpose

Nabren
Inspiring
March 4, 2013

Ask your teacher for help - they should not give you a task that they could not do themselves. We suggested some methods for you to implement. If you are unsure how to do this go back and ask your teacher I am sure they would be happy if you asked for help.

I would rather not give the answer because it cheapens the exercise. I already made that mistake once. I will be happy to continue to answer questions and provide guidance. However, I expect you to be able to implement the suggestions yourself.

Nabren
Inspiring
February 28, 2013

Basically you need to apply a spacing algorithm to your random positioning. The short answer is when randomly choosing positions make sure another obstacle or coin was not placed within the immediate area. There are many ways to accomplish that.

A quick Google search for what I just mentioned should turn up many results.

Known Participant
March 2, 2013

I can't fix it! :((((((((

Can you please show me some codes. Please sir. The deadline is already is very near and i need to fix this. Please help.

Would arrays work?.

Please help me code it sir. Or just a sample code with some dumb explanations please

Mark.fromOP
Inspiring
March 3, 2013

Do a random number generator to get random x and y values or speed or whatever else you need. Flash has ways of doing this, google flash, random number.