how to change velocity on collide?

About advanced scenes, and the Thyme scripting language used in Algodoo.

what is the max$ you would pay for a game

Poll ended at Sat Apr 03, 2010 8:05 pm

none
3
25%
free-10
4
33%
11-20
1
8%
21-30
2
17%
31-40
0
No votes
41-75
0
No votes
76-150
0
No votes
151-250
1
8%
251-500
0
No votes
I don't care if it is 10,000,000 or any amount.
1
8%
 
Total votes : 12

how to change velocity on collide?

Postby matt28 » Thu Dec 24, 2009 8:05 pm

title says it...
so is it like
Code: Select all
onCollide = (e)=>{e.other.vel = [(x)speed,(y)speed]}

or any other suggestions???
is speed vel, veocity, speed, v or what else?????????????
matt28
 
Posts: 7
Joined: Wed Dec 23, 2009 11:19 pm

Re: how to change velocity on collide?

Postby standardtoaster » Thu Dec 24, 2009 8:32 pm

You cannot change the velocity of a preexisting object. You can, however, change the velocity of an object if you spawn it.
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: how to change velocity on collide?

Postby Kilinich » Thu Dec 24, 2009 9:16 pm

matt28 wrote:title says it...
so is it like
Code: Select all
onCollide = (e)=>{e.other.vel = [(x)speed,(y)speed]}

or any other suggestions???
is speed vel, veocity, speed, v or what else?????????????


You can see all properties names in .phn file. You can't access vel or pos directly (even for read) so only way to change speed - kill object (set density=0 for example) and spawn same new one with speed you need.
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: how to change velocity on collide?

Postby RA2lover » Thu Dec 24, 2009 11:02 pm

you can access vel or pos using the grady's new method.
Jrv wrote:
TC42 wrote:Quite honestly, I didn't think anyone on 4chan has that good a use of grammar, spelling, usage, mechanics, ect.
But I've never been there, so I may be wrong.


GTFO newfgt
User avatar
RA2lover
 
Posts: 607
Joined: Mon Aug 31, 2009 8:43 pm
Location: Brazil

Re: how to change velocity on collide?

Postby jessebax129 » Thu Jan 06, 2011 10:13 pm

it's not possible :thumbdown:
jessebax129
 
Posts: 34
Joined: Tue Jan 05, 2010 6:32 pm


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 2 guests