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: 674

Views: 948

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 little scripting 1X1 (tutorial)
Rating: 5
Filesize: 44.27 kB
Downloads: 477
Comments: 2
Ratings: 3
Date added: 2010/12/27 21:06:45
Made with: Algodoo before v1.8.5
Rating: rated 5
download
Title: Team Marble Course
Rating: 5
Filesize: 176.1 kB
Downloads: 571
Comments: 0
Ratings: 1
Date added: 2020/03/29 20:10:45
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Learn Maths Substraction
Rating: 5
Filesize: 263.41 kB
Downloads: 1245
Comments: 0
Ratings: 1
Date added: 2023/07/08 13:08:56
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: cannon + pirateship
Rating: 5.375
Filesize: 109.84 kB
Downloads: 758
Comments: 1
Ratings: 2
Date added: 2009/07/31 01:59:24
Made with: Phun
Rating: rated 5.4
download
Title: A simple suspention tutorial
Rating: 5
Filesize: 40.43 kB
Downloads: 1035
Comments: 7
Ratings: 8
Date added: 2013/03/16 21:52:09
Made with: Algodoo v2.0.2 Edu
Rating: rated 5
download
Title: Mounted Minigun (PHUN ONLY)
Rating: 5.8889
Filesize: 57.57 kB
Downloads: 2173
Comments: 13
Ratings: 3
Date added: 2009/11/29 06:22:18
Made with: Phun
Rating: rated 5.9
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? :(