Image:
Author: FruitMonger Group: Default Filesize: 14.94 kB Date added: 2010-11-16 Rating: 5 Downloads: 204 Views: 534 Comments: 0 Ratings: 1 Times favored: 0 Made with: Algodoo before v1.8.5 Tags:
|
Simple headlight and tail light that turn on and off. Tap 1 to turn on the headlight, and tap 2 to turn on the tail light.
How to make a headlight:
Make a headlight shape.
Make a shape that you light is going to be in.
Make the same shape, but bigger and further forward, so that they line up properly.
Do the same thing again.
If they do not line up, make the smaller light pieces slightly bigger, so that they stick out a bit from the bigger light, and use csg cut with the bigger one, so they've all got the same edge.
Make a custom variable.
Make the custom variable scene.my.X := [1, 1, 1, 0.3].
Make the color of the light pieces {scene.my.X}.
Now make two small balls inside of the headlight, and make a toggle collider so that when you tap one key, it hits the other one, and htne the other one.
Make one ball's oncollide scripting (e)=>{scene.my.X = [1, 1, 1, 0.3]}.
Make the other one's scripting (e)=>{scene.my.X = [1, 1, 1, 0.3]}.
It doesn't matter which has which script, as long as one has one, and the other has the other.
Now if you tap your toggle key (I made mine 1), the light should turn on/off.
How to make a tail light:
Do the same thing as with the headlight, but make you custom variable scene.my.V = [1, 1, 1, 0.7], instead of 0.3.
Take the two bigger lights off of the tail light.
You make the variable [1, 1, 1, 0.7] because the lights don't add up, since there's only one. If you know anything about translucency, you'll know what I'm talking about.
Now, you shoud have a tail light and headlight that work like these ones.
Tutorials and scene made for pivottribal for his car. |