Community

i need help with simple game

Posted Aug 18, '10 at 7:00pm

FutterWacken

FutterWacken

45 posts

Wood - Squire

im currently creating a game which involves getting a coin( cant get the score to rise above 1)
and the coin vanishes off screen
so plz correct this code(as2):
if (_root.coin.hitTest(hero_collect)) {
        _root.coin._x = Math.random()*500+50;
        _root.coin._y = Math.random()*500+50;
        ++_root.scorenumber;
        _root.score = "Score: " + _root.scorenumber;
}
SUPER THANKS!!!

Posted Aug 19, '10 at 11:19pm

alsage

alsage

124 posts

Wood - Lord

so whats with the roots? are you doing this within a movie clip or what?

 

Posted Aug 20, '10 at 4:29pm

FutterWacken

FutterWacken

45 posts

Wood - Squire

yes i am doing this within a movieclip and if you cant understand what im saying than plz ask for a screenshot or a better explanation
ty

 

Posted Aug 20, '10 at 4:58pm

alsage

alsage

124 posts

Wood - Lord

ok can you give me a better explanation of what is going wrong?

 

Posted Aug 25, '10 at 11:07am

FutterWacken

FutterWacken

45 posts

Wood - Squire

ok
the ball touches the coin but score does not go higher than 1
sometimes coin disappears off screen
see for yourself

 

Posted Aug 25, '10 at 2:08pm

alsage

alsage

124 posts

Wood - Lord

I figured out first problem... the disappearing thing
Its quite an easy solution

        _root.coin._x = Math.random()*500+50;
        _root.coin._y = Math.random()*500+50;

that means your coin will re appear at 550 on the x and y axis when your file is only 500x400...

_root.coin._x = Math.random()*400;
        _root.coin._y = Math.random()*500;

 

Posted Aug 25, '10 at 2:16pm

alsage

alsage

124 posts

Wood - Lord

sorry it will still disappear from screen sometimes unless you subtract coins width from 400. and height from 500... and that border you have around might also hide it

 

Posted Aug 26, '10 at 5:31am

FutterWacken

FutterWacken

45 posts

Wood - Squire

DUDDDDEEEE
thanks but what i REALLY need is the score problem solved
p.s: did you like it?? ^_^

 

Posted Aug 26, '10 at 7:01pm

alsage

alsage

124 posts

Wood - Lord

Still trying to figure out the score problem but I just noticed that and I decided to put it in... The score is a bit confusing I dont see why its not working. and yes the game is really cool It is going to be an awesome game to have on the site =D

 

Posted Aug 26, '10 at 7:06pm

ug5151

ug5151

171 posts

Wood - Squire

Look on the Internet. There's lots of stuff on that.

 

Posted Sep 3, '10 at 5:25am

FutterWacken

FutterWacken

45 posts

Wood - Squire

@alsage aww thnx a LOT!!!
its mai first real bit of code really
the others were just tips and tricks off the internet and stuff

@ug5151 i already looked, there is NOTHING!! =(

 
Reply to i need help with simple game

You must be logged in to post a reply!