Music Box
The music box was created a while ago to test the behaviour framework. I have been busy teaching and marking these days. Thought I should write a blog then resume marking......
The behaviour of the music box is simple. Click on the box can toggle on or off the music.
In this music box, a Click event on the box will trigger the Action of toggle on the Audioclip. The Behaviour Framework was posted in the forum. You can also check out the Logo Guide/Reference Behaviour section in the wiki to find out more.
The Logo program producing this Music Box world is displayed below with comments. If you are in the VRMath2 Editor, you can open the logo file from Example folder.
; music box by Andy Yeh (2014) ; CS RESET ; clear screen and reset scale/material etc. BOX ; create a cube MAKE "box OBJECT ; store the object id of the box SELECT :box ; simulate clicking on the cube SETIT RANDOM 11 RANDOM 36 ; apply a random texture UP 1 SETMAT RANDOM 16 RANDOM 36 ; apply random material LABEL [TOGGLE music] UP 1 SETMAT RANDOM 16 RANDOM 36 ; apply random material LABEL [CLICK the BOX TO] SOUND "/sites/default/files/webfm/public/media/sound/music/light_rock/ama_02-1.mp3 TRUE TRUE MAKE "music WORD OBJECT "_audioclip ; store the music clip id ; create the behavior TOGGLE "act1 :music "enabled ; create a toggle action named act1 CLICK :box "act1 ; associate box click to act1 ; ; the next step could be changing background and adding some disco light...
As you can see in the Logo program, everytime you run it will give you random materials on the texts and random image texture on the box. The music is also nice (at least I think so ). I can listen to it for some hours as background music when doing house work. You can change music if you like, and improve from the program above.
Enjoy.
- Andy's blog
- Login or register to post comments
- 5135 reads