0 Reputation

Get the "Speed" of an object

Forum Home > Construct 2 General > How do I....?
 Author Message    Topic Search   Topic Options 1,446 Rep Post Options    Quote  Reply Topic: Get the "Speed" of an object    Posted: 03 Nov 2011 at 3:11pm I am looking to get the speed of an object with physics being shot out of a cannon and cant seem to work it out, here is a capx of the general idea, any help would be greatly appreciated.http://dl.dropbox.com/u/47975195/Speedofball.capx 9,788 Rep Post Options    Quote  Reply Posted: 03 Nov 2011 at 4:46pm 3DGS,Speed = Distance/Time, so you need to determine the distance traveled by the cannon ball in a specific period of time, like every tick.Here is a modified capx: http://dl.dropbox.com/u/38038537/Speedofball_modified.capxThis was just a quick and dirty example, and I'm sure there must be a more elegant solution (perhaps even built-in). 1,446 Rep Post Options    Quote  Reply Posted: 03 Nov 2011 at 7:14pm thank you, that helps alot! 22,366 Rep Post Options    Quote  Reply Posted: 03 Nov 2011 at 8:04pm The physics expressions 'velocity x' and 'velocity y' are probably what you are looking for. I am not sure how to combine them to give you a good indication of actual velocity but it can't be that hard (most of the people hare are maths geniuses anyway ;) ) 7,880 Rep Post Options    Quote  Reply Posted: 03 Nov 2011 at 8:54pm distance(0, 0, velocity_x, velocity_y)will give you the speed.angle(0, 0, velocity_x, velocity_y)will give the direction. 9,788 Rep Post Options    Quote  Reply Posted: 03 Nov 2011 at 9:26pm See? I knew there would be a more elegant solution.Here is the capx again, with R0J0's information: http://dl.dropbox.com/u/38038537/Speedofball_modified.capx 1,446 Rep Post Options    Quote  Reply Posted: 04 Nov 2011 at 12:00pm awesome thank you guys for the help i am really enjoying this program, and the community! 2,035 Rep Post Options    Quote  Reply Posted: 10 Aug 2012 at 5:10pm This is exactly what I was looking for, thank you. I never thought of using velocity like that. Totally makes sense.

 Forum Jump -- Select Forum --  Arcade  Construct 2 general  How do I....?  Your Creations  Education  Bugs   - Closed bugs  Plugins for Construct 2  Javascript SDK development  Open Topic  General game design  Tools/resources  Website issues  Help Wanted  Construct Classic Discussion   - Help & Support using Construct Classic   - Your tutorials & example files   - Your Creations   - Completed addons   - Work-in-progress addons   - Construct engineering Forum Permissions You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot delete your posts in this forumYou cannot edit your posts in this forumYou cannot create polls in this forumYou cannot vote in polls in this forum