less then(<) and greater then(>)

Game Editor comments and discussion.

Postby Game A Gogo » Fri Aug 25, 2006 12:20 am

there seems to be a problem whit the "less then(<)" and "greater then(>)" sign in the sript editor when you put it in drawing, the action is use if Acotr1 is more to left or right then it dos an action.
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby makslane » Fri Aug 25, 2006 12:26 am

Can you post the code?
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Game A Gogo » Fri Aug 25, 2006 12:46 am

ok, here it is:
Code: Select all
if(PlayerN==1)
{
if(Pause)
{
    if(Ball.x<x)
    {
        x-=Level+1/2;
    }
    else if(Ball.x>x)
    {
        x+=Level+1/2;
    }
}
}
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby makslane » Fri Aug 25, 2006 12:54 am

What's the problem?
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Game A Gogo » Fri Aug 25, 2006 12:59 am

The actor just remain in place, even if the Ball actor is moving.
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby makslane » Fri Aug 25, 2006 1:08 am

Make sure the value of PlayerN is 1 and Pause is different of 0.
Put some tests in your code to track this.

You can use a actor text to debug.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby DilloDude » Fri Aug 25, 2006 1:18 pm

Code: Select all
1/2
I think this is the problem. Since 1 is an integer, it does an integer ivision returning the result as an integer. 1 / 2 = .5, when converted to an integer it equals 0. Try
Code: Select all
1.0/2
If you have a variable, you can use
Code: Select all
(var + .0)
or
Code: Select all
round(var)//because round returns a real.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby Game A Gogo » Sun Aug 27, 2006 9:44 pm

then maybe this will work:
Code: Select all
(PlayerN+1)/2;
?
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest