- Code: Select all
if(x>PongBall.x) x-=8;
else if(x<PongBall.x)x+=7;
to make AI, and it works, but then there is the fact that my actor shakes while moving.
if(x>PongBall.x) x-=8;
else if(x<PongBall.x)x+=7;
Hblade wrote:use this
- Code: Select all
if(x>PongBall.x+2) x-=8;
else if(x<PongBall.x-2)x+=7;
NightOfHorror wrote:wait, how do you update it only two times a second. I am confused.
timer++;
if(timer>=15)
{
// put your movement code here
timer=0;
}
NightOfHorror wrote: One, what does ++ do
NightOfHorror wrote: is there an automatic 30 frames a second in GE?
NightOfHorror wrote:last question. Sometimes if I hit the ball, it goes out of the playing area, or it gos in this block that I made in each corner. What is wrong with it. Is it just how I put in physical response. Everything is 1.
If(ColorScore.textNumber>=10);
{
DestroyActor("ColorBall");
}
textNumber = var;
NightOfHorror wrote:I need it when an actor in the game gets ten points it is destroyed. So if the ball hits its wall it gains a point, but at ten is eliminated from the game. I put in a code that destroys them when they get one point. Why isn't it working.
- Code: Select all
If(ColorScore.textNumber>=10);
{
DestroyActor("ColorBall");
}
Users browsing this forum: No registered users and 1 guest