[Help] Collision Change Script
5 posts • Page 1 of 1
[Help] Collision Change Script
I've been searching around for a thyme script where a laser hits a geometry/object and it multiplies the collision set number by 2. Basically each time the laser hits the number increases like this, 1, 2, 4, 8, 16, 32, etc. Can anyone help me figure out the script/ let me copy past it? I'm going to need the script for a thing i'm working on! The script also needs a limiter in itself where when it comes to a certain number it stops increasing.
Epic
-
InsertNameHere - Posts: 60
- Joined: Tue May 27, 2014 11:31 pm
- Location: Claremore Oklahoma
Re: [Help] Collision Change Script
onLaserHit = (e) = {collideSet = clamp(collideSet * 2, 0, 512)}
Dream of Algodoo as game development engine...
-
Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: [Help] Collision Change Script
cool thanks this will be helpful to me dude
EDIT: Using this script just changes the LASERS script and not the circle and the collide set only changes 1 time...?
EDIT: Using this script just changes the LASERS script and not the circle and the collide set only changes 1 time...?
Epic
-
InsertNameHere - Posts: 60
- Joined: Tue May 27, 2014 11:31 pm
- Location: Claremore Oklahoma
Re: [Help] Collision Change Script
How about using onLaserHit to change any object, unless specified, to helium?
- Willt125
- Posts: 2
- Joined: Tue May 26, 2015 10:13 pm
Re: [Help] Collision Change Script
The code is:
onLaserHit =(e)=>{e.geom.collideSet = clamp(e.geom.collideSet * 2, 0, 512)}
onLaserHit - the laserhit event
(e)=>{} - the method
e.geom.collideset = - setting the collideset of the geometry that was registered by the event
= clamp() - limiting the value to 0 and 512 so it wont exceed these
e.geom.collideset * 2 - doubling the collision number of the object
This should work
onLaserHit =(e)=>{e.geom.collideSet = clamp(e.geom.collideSet * 2, 0, 512)}
onLaserHit - the laserhit event
(e)=>{} - the method
e.geom.collideset = - setting the collideset of the geometry that was registered by the event
= clamp() - limiting the value to 0 and 512 so it wont exceed these
e.geom.collideset * 2 - doubling the collision number of the object
This should work
- FRA32
- Posts: 229
- Joined: Wed Dec 03, 2014 9:51 pm
5 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests