Get Speed

For questions about using Classic.

Post » Wed Sep 22, 2010 9:34 am

Hey all

I was wondering how you could save in private variable speed and direction at a specific point
preferly for platform movement or custom movement
B
3
G
2
Posts: 16
Reputation: 707

Post » Sun Nov 21, 2010 8:48 pm

Well. You can make an invisible block with no solid attributes or anythig. Then you can say:

Player:On collision with INVISIBLE block:Set private variable speed=player[Platform].Speed
and in the same event:player:set private variable angle=player.angle

Here is a cap:http://dl.dropbox.com/u/7605789/Privatevariable.cap
B
2
G
2
Posts: 30
Reputation: 710

Post » Sun Nov 21, 2010 8:50 pm

What would you use this for anyway? Just curious. . .
B
2
G
2
Posts: 30
Reputation: 710

Post » Mon Nov 22, 2010 12:43 am

If you don't want to create a dummy object you could also use a small loop.
Be sure to use int() tho...or the comparison might not ever hit.
+ System: For "n" from 315 to 325
-+ System: int(Sprite.X) Equal to LoopIndex("n")
--+ System: Trigger once
----> Sprite: Set 'speed' to Sprite[Platform].Speed
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests