Keensta1
04-22-2009, 04:56 PM
Hi im making a little game to show some mates how to use actionscript.
Im ok at it. Im making a simple moving game and you have to collect a sqaure to get 1 point i have point thing up a running.
So heres rhe problum Im using a hittest for the ball to hit the point object (i refer to i as point because its instent name is Point).
so i have all the movement for the ball.
I entered this code after all the code and placed at the end.
if (_root.Point.hittest(_x, _y, true)){
score++;
_root.Point._x= Math.random(530)+25
_root.Point._y= Math.random(650)+25
Thats the code it works. Also that off the top of my head. So i tested it and it worked but after hiting it once it moves to a diffrent place fine so i go get it again and notice it moving but back to the same place.
I asked my teacher He great at it he said theres a code you can put there so it proper random ( he said he just cant think what it is) and does not like go to _x=100 _y=100 like for every.
I want it so it changes the _x and _y changes every time.
That code works just after once its touched first it work but second it stays in the same place all the time.
So if you have the code for the bit to make it so the math.random is totaly random would be great if you could write the whole hit test bit.
Im ok at it. Im making a simple moving game and you have to collect a sqaure to get 1 point i have point thing up a running.
So heres rhe problum Im using a hittest for the ball to hit the point object (i refer to i as point because its instent name is Point).
so i have all the movement for the ball.
I entered this code after all the code and placed at the end.
if (_root.Point.hittest(_x, _y, true)){
score++;
_root.Point._x= Math.random(530)+25
_root.Point._y= Math.random(650)+25
Thats the code it works. Also that off the top of my head. So i tested it and it worked but after hiting it once it moves to a diffrent place fine so i go get it again and notice it moving but back to the same place.
I asked my teacher He great at it he said theres a code you can put there so it proper random ( he said he just cant think what it is) and does not like go to _x=100 _y=100 like for every.
I want it so it changes the _x and _y changes every time.
That code works just after once its touched first it work but second it stays in the same place all the time.
So if you have the code for the bit to make it so the math.random is totaly random would be great if you could write the whole hit test bit.