Browse Search Popular Register Upload Rules User list Login:
Search:
click if you wanna learn scripting

Image:
screenshot of the scene

Author: falandysz

Group: Default

Filesize: 33.7 kB

Date added: 2010-11-29

Rating: 5.7

Downloads: 441

Views: 674

Comments: 12

Ratings: 3

Times favored: 0

Made with: Phun

Tags:
learn,
script,
tutorial

Scene tag

hello if you want to learn a script or 2 or 10 or so just ask in comment or look at those scripts beneath this text...

(e)=>{ e.this.density=e.other.density } density can be changed to almost anything restitution, airfrictionmult, friction, attraction or other the 2 densities/other don't have to be the same you can make a circle hit a box and get the box density

(e)=>{scene.addcircle ( { pos=e.pos; density:=12; color:=[0,0,0,1]; attraction:=3; radius:=4; oncollide=(e)=>{scene.addbox({ pos=e.pos; density:=13; color:=[0,1,0,1]; length:=2; height=:1 }) } } ) }that will spawn circles that spawns boxes :tup: try playing around with the valus and variables :tup:

some of the scripts used for... well something

(e)=>{ e.this.density=e.this.density +2; e.this.oncollide=(e)=>{e.this.density=e.this.density +2; e.this.oncollide=(e)=>{ e.this.oncollide=(e)=>{} }} } that will change a density to its own density +2 every time it hits something but with the extra scripts it will do it 2-3 times before loosing all effect :tup:

(e)=>{ e.this.texture=e.other.texture } if having something like a textured box you can use this script on a circle or so and when it hits the box it will get same texture :tup:

to spawn a box use size:=[ 1, 2 ] or so to tell size

and to spawn a tracer use scene.addpen({ the script you want })
and please rate this scene if I have helped you in any way :tup:

you can also add me on Skype (my Skype name is casper418161) or msn (my email/msn name is falandysz@live.dk)
Last edited at 2010/12/04 21:44:25 by falandysz
Please log in to rate this scene
edit
Similar scenes
Title: The Absorber tutorial
Rating: 6.3
Filesize: 242.45 kB
Downloads: 384
Comments: 3
Ratings: 4
Date added: 2010/11/22 17:49:55
Made with: Phun
Rating: rated 6.3
download
Title: car turned on/off with script
Rating: 6
Filesize: 32.46 kB
Downloads: 331
Comments: 0
Ratings: 3
Date added: 2010/12/02 16:27:37
Made with: Phun
Rating: rated 6
download
Title: Mounted Minigun (PHUN ONLY)
Rating: 5.8889
Filesize: 57.57 kB
Downloads: 1970
Comments: 12
Ratings: 3
Date added: 2009/11/29 06:22:18
Made with: Phun
Rating: rated 5.9
download
Title: Learn About WED
Rating: 5
Filesize: 10.95 kB
Downloads: 125
Comments: 1
Ratings: 1
Date added: 2014/02/22 17:21:52
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Mouse Controlled Sniper Game
Rating: 5
Filesize: 149.36 kB
Downloads: 1063
Comments: 13
Ratings: 1
Date added: 2010/12/16 17:43:06
Made with: Phun
Rating: rated 5
download
Title: Gas-operation tutorial (guns)
Rating: 5.625
Filesize: 92.11 kB
Downloads: 433
Comments: 3
Ratings: 2
Date added: 2014/07/01 21:00:07
Made with: Algodoo v2.1.0
Rating: rated 5.6
download
I can teach too. Add my msn:noritsu99@hotmail.com
yeah i know that _o_ :y
Ive been trying to find a way to learn how to spawn boxes, im somewhat new and im not sure how that works.
I will try to explain... in the oncollide text box type something like (e)=>{ scene.addbox({pos=e.pos; density:=12; size:=[1,2] }) } that should if spelled right spawn a box higher than it is wide :tup: you can maybe add something like this to spawn a certain amount of the box... (e)=>{ for(13, (i)=>{ spawn-script }) } that will spawn 13 of a box or circle depending on which script you use :tup:

just ask if I didn┤t explain it good enough or if you have other questions?
Last edited at 2010/12/11 11:12:47 by falandysz
Alright, i think i got it. I tried it and it it spawned into a box. If i put scene.addcircle( etc. would it spawn a circle or is there another code i have to put in? Sorry, im kinda new at this and im only 14 and maybe thinking about engineering so i figured this would be a kinda cool way to get familiar with physics.:)
well I am only 13 years old but I also plan becoming engineer but the answer to your question is YES...

but with circle use radius to tell size instead of height and length :tup:

(e)=>{scene.addcircle({pos=e.pos, radius:=2})} something like that :tup:

you can also spawn hinges springs tracers and so just use the name for the different stuff like reversed that way it is spelled in the script page of a normal one :tup:
Last edited at 2010/12/02 15:03:06 by falandysz
Thats cool, engineering is just something im interested in because of i love working with my hands and like to know how things work.
and alright. so to spawn a tracer what would be the code?
the code would be (e)=>{ scene.addpen({ size:=1; color:=[0,1,0,1]; }) }
alright. thanks much.
add me on skype my username is casper418161 :tup: then it is much easier to help you :tup:
To Spawn Anything!!
1. Select Anything You Want To Spawn
2. Press Ctrl+C
3.Goto Notepad And Press Ctrl+V
4.Select All And Press Ctrl+C
5.Goto Phun And Goto Oncollide Script And Press Ctrl+V
If You Want It To Spawn Right Where The Spawner Is, Change The Pos To [e.pos]
I really need the script to spawn multiple circles at once. I tried using your (e)=>{for(13, (i)=>{scene.addcircle{pos:=e.pos; radius:=1; color:=[1,1,1,1]}})} but it didn't work. can you please explain this again? :(