toggle menu
Categories
Discussions
Dashboard
Sign In
·
Register
Sign In
·
Register
Categories
Discussions
Dashboard
Sign In
·
Register
×
Home
›
GameSalad 101
›
Working with GS (Mac)
moving back forth and upward?
ragg
Member
Posts:
65
February 2010
edited November -1
in
Working with GS (Mac)
hi,how to make an actor to move right and left while moving upward?i only can make it move up or back and forth...but not both at the same time..help pls..
Comments
ragg
Member
Posts:
65
February 2010
anyone help pls?
ragg
Member
Posts:
65
February 2010
hey guys...help please...really appreciated
scitunes
Member, Sous Chef
Posts:
4,047
February 2010
you must use accelerate not move or change velocity.
Here is a trick to get it to feel like move.
RULE (ALL)
When right key is pressed
self.linear.X < 250 (or whatever you have been setting the move rate to)
accelerate 0 degrees 2000 (you want this big so it gets to your desired speed instantly)
OTHERWISE
Change velocity to 0 relative to actor
---------------------------------
RULE (ALL)
when left is pressed
when self.linear.X is > -250
accelerate 1800 degrees 2000 (you want this big so it gets to your desired speed instantly)
OTHERWISE
Change velocity to 0 relative to actor
These rules will feel like move, but will work while jumping or falling.
ragg
Member
Posts:
65
February 2010
thanks for reply...but i want the actor to constantly moving back ,forth and upward itself without control....any idea?
scitunes
Member, Sous Chef
Posts:
4,047
February 2010
Create a boolean attribute - MovingRight
RULE
When self.position.X < 20
-change attribute game.MovingRight to true (1)
RULE
When self.position.X>460
-change attribute game.movingRight to false (0)
RULE
moving right is true
self.linear.X < 250 (or whatever you have been setting the move rate to)
accelerate 0 degrees 2000
RULE
when moving right is false
when self.linear.X is > -250
accelerate 180 degrees 2000
You can change 20 and 460 to constrain the how far left and right it moves.
To make it move up:
when self.linear.Y < 300 (change this to whatever speed you want)
accelerate 90 degrees 2000
Sign In
or
Register
to comment.
Comments
Here is a trick to get it to feel like move.
RULE (ALL)
When right key is pressed
self.linear.X < 250 (or whatever you have been setting the move rate to)
accelerate 0 degrees 2000 (you want this big so it gets to your desired speed instantly)
OTHERWISE
Change velocity to 0 relative to actor
---------------------------------
RULE (ALL)
when left is pressed
when self.linear.X is > -250
accelerate 1800 degrees 2000 (you want this big so it gets to your desired speed instantly)
OTHERWISE
Change velocity to 0 relative to actor
These rules will feel like move, but will work while jumping or falling.
RULE
When self.position.X < 20
-change attribute game.MovingRight to true (1)
RULE
When self.position.X>460
-change attribute game.movingRight to false (0)
RULE
moving right is true
self.linear.X < 250 (or whatever you have been setting the move rate to)
accelerate 0 degrees 2000
RULE
when moving right is false
when self.linear.X is > -250
accelerate 180 degrees 2000
You can change 20 and 460 to constrain the how far left and right it moves.
To make it move up:
when self.linear.Y < 300 (change this to whatever speed you want)
accelerate 90 degrees 2000