Powered by Invision Power Board

 
    Reply to this topicStart new topicStart Poll

> Testing speed of a rotating object., GM6.1
United States
Elyk
Posted: Jan 2 2008, 08:16 PM
Quote Post


Standard Member
[*][*][*][*]

Group Icon
Group: Members
Posts: 6604
Member No.: 3808
Joined: 22-May 07

Status: (0d) [--]


How do you check the speed of a rotating object, more specifically, one set to point to a direction? I want to make it so that way it makes a slash sound if the player swings the sword fast enough.
PMEmail PosterUsers WebsiteAOLMSN
Top
Greece
rogueyoshi
Posted: Jan 4 2008, 07:32 PM
Quote Post


Watch out for that zoo
[*]

Group Icon
Group: Members
Posts: 346
Member No.: 3742
Joined: 8-May 07

Status: (0d) [--]


create event:
CODE
image_angle_previous = image_angle;
image_angle_speed = 0;// use this for checking

end step event:
CODE
image_angle_speed = image_angle - image_angle_previous;
image_angle_previous = image_angle;

hope this is what you're looking for.

EDIT: fixed a little typo in the end step event

This post has been edited by rogueyoshi on Jan 5 2008, 12:43 AM


--------------------
#SNKPlaymore @ EFnet
Don't have a clue how to play KOF? Want one? http://tinyurl.com/kofguide
Tell SNK their netcode sucks ASS!! http://tinyurl.com/snkonline

user posted image
PMAOLYahooMSN
Top
United States
Elyk
Posted: Jan 4 2008, 07:48 PM
Quote Post


Standard Member
[*][*][*][*]

Group Icon
Group: Members
Posts: 6604
Member No.: 3808
Joined: 22-May 07

Status: (0d) [--]


QUOTE (rogueyoshi @ Jan 4 2008, 07:32 PM)
create event:
CODE
image_angle_previous = image_angle;
image_angle_speed = 0;// use this for checking

end step event:
CODE
image_angle_speed = image_angle - image_angle-previous;
image_angle_previous = image_angle;

hope this is what you're looking for.

awesome, thanks
PMEmail PosterUsers WebsiteAOLMSN
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Reply to this topicStart new topicStart Poll

 




[ Script Execution time: 0.0411 ]   [ 14 queries used ]   [ GZIP Enabled ]   [ Server Load: 0.72 ]