Chooper's 3D Engine + sound, again
WASD Move player
Arrow keys Rotate camera
E Open / close door (must be near to the door)
M Toggle mouse controls (click and drag)
O Show options
F Toggle FPS Counter
Activate by pressing O and disabling default controls
Drag the mouse to rotate the camera (instead of arrow keys)
Can now also be toggled by pressing M
• Added new sounds for walking on different objects. Credits to Minecraft!
• Walk sound plays after you land on the ground. (Really the walk frame timer gets reset.)
• Experimented with sounds some more - now there's an audio source. That's the blue diamond object.
- (( NO LONGER RELEVANT )) Note: This actually requires a new forever loop that runs every tick to run smoothly.. this is because "set volume" actually forces the screen to redraw - no good! Ironically this is actually because of a bug fix, see LLK/scratch-flash#420. And putting it in a no-refresh block didn't seem to help.. :(
- Fixed that! Just put the set-volume in "after tick", rather than "tick" :)
• Audio sources can be made in the sounds sprite - each is linked to an object. That sprite actually works as a module - you can import it into your own 3D engine project and it'll work fine. (This is based on version 1.6 of the 3D engine - hopefully nothing breaks and makes this not work!)
- Because each audio is clone based you can have up to 300 sound sources playing at once (assuming no other clones). Maybe later I'll make it more efficient so that it only has clones for the currently playing sounds! (edit - though that might not work.. sounds resetting, right? Maybe have a "persistent" variable for each sound?)
• Looping (and not) sounds - just set the #Looping variable to 1 or 0 when creating the sound clone!
• Quick update Aug. 28th - fixed the volume formula for hearing ranges ≠ 500.
Bonus credits to @chooper-beta for helping me out some more! (Particularly with figuring out the surface that's below the camera.)