Browse Search Popular Register Upload Rules User list Login:
Search:
Timers and events demo

Image:
screenshot of the scene

Author: Kilinich

Group: Default

Filesize: 1.94 kB

Date added: 2010-01-17

Rating: 6.7

Downloads: 1291

Views: 1397

Comments: 7

Ratings: 5

Times favored: 0

Made with: Phun

Tags:
timer,
alarm,
event

Scene tag

This is event handling toolkit demo (phun/algodoo).
Run sim and watch! In the beginning - there is no object on scene.

source on forum

To make another events by yourself just call (type in console or on collision) one of functions:

To make a timer:
scene.my.newTimer(countdown, {{action}}, repeat);
for example: scene.my.newTimer(1, {{sim.running = false}}, true) will stop simulation every second.

To make an alarm:
scene.my.newAlarm(time, {{action}});
for example: scene.my.newAlarm(10, {{scene.camera.pan = [0,0]}}) will move focus to 0,0 at 10 second of sim.

To make custom event:
scene.my.newEvent(time, countdown, count, {{action}});
for example: scene.my.newEvent(7, 1, 10, {{scene.addCircle({pos=[0,0]})}}) will spawn 10 circles one by one every 1 sec after 7 sec sim time.
Last edited at 2010/06/04 19:26:51 by Kilinich
Please log in to rate this scene
edit
Similar scenes
Title: Basic timers for scripts made with motors and collisions.
Rating: 5
Filesize: 28.94 kB
Downloads: 628
Comments: 0
Ratings: 1
Date added: 2009/06/07 00:50:24
Made with: Phun
Rating: rated 5
download
Title: New Algicosathlon Event 4
Rating: 5
Filesize: 91.59 kB
Downloads: 980
Comments: 1
Ratings: 1
Date added: 2016/07/09 17:13:45
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Algotriacontathlon Day 1 (YT Only)
Rating: 5
Filesize: 100.87 kB
Downloads: 1504
Comments: 0
Ratings: 1
Date added: 2017/05/16 13:59:53
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Transflame 143 Smoke Alarm
Rating: 5
Filesize: 40.43 kB
Downloads: 540
Comments: 0
Ratings: 1
Date added: 2013/03/03 15:38:13
Made with: Algodoo v2.0.1
Rating: rated 5
download
Title: Events II Demo
Rating: 6.1111
Filesize: 7.69 kB
Downloads: 1046
Comments: 1
Ratings: 3
Date added: 2010/10/18 10:21:55
Made with: Algodoo before v1.8.5
Rating: rated 6.1
download
Title: Algotriagicosathlon Event 1
Rating: 5
Filesize: 55.36 kB
Downloads: 1884
Comments: 20
Ratings: 1
Date added: 2015/01/18 23:14:35
Made with: Algodoo v2.1.0
Rating: rated 5
download
как всегда десяточку мастеру фана и алгуду)))
Да было бы за что - я не придумал пока как эти таймеры красиво показать;)
dette er som å gå på skole, det er kjedelig:|
ЗА ИДЕЮ!:tup:
You should use Scene.camera.pan to center the screen at the start. That way you can see the circles spawning without having to adjust the camera. Just a nice touch ;)
Last edited at 2010/01/19 19:21:47 by Paradigm 29
如何選擇週一大小的圓,木箱等?
:bonk: chinese