APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

A game with audio post and replies

Return to the A game with audio thread
Login to post to this thread

How to trigger a sound using audio - June 23, 2015 at 11:32
Chi-Feng Lin
28 Posts

Dear all

I am making a small game. The game is that some falling apples are caught by a bucket.

My question is how to make a sound when the bucket catches a apple.

Many thanks

Attached File: ejss_src_Unnamed.zip


Replies to How to trigger a sound using audio

Re: How to trigger a sound using audio - June 24 2015 11:36
lookang Avatar
lookang
221 Posts

add the following line at this position


function Recordnum () {
  counts = counts +1;
  _view.audio.play(); //lookang
  
}


but the code is not robust enough for 2 very fast apples

but paco or wolfgang can advise on that.

or else it works!
enjoy!

Attached File: ejss_model_Unnamed.zip


OSP@SG blog
OSP@SG Digital Library


Re: Re: How to trigger a sound using audio - June 25 2015 1:30
Chi-Feng Lin
28 Posts

Dear lookang

The game has more fun now.

I will try to short the music to improve it.

Thank you.



Re: Re: How to trigger a sound using audio - September 01 4:20:PM
Tom Howard
1 Posts

A basic fascinating recipe, have you as of late attempted it? When do you intend to open a club at the lodging? Plainly, I like to play on the web, for instance here https://newcasinos-nz.com/casinos/paysafe, yet now and again I visit club at inns where I stay on work trips on business issues. I like to remove up like this with a glass of bourbon and playing blackjack, I check cards well indeed and win continually.



Re: Re: How to trigger a sound using audio - September 02 3:18:PM
lookang Avatar
lookang
221 Posts

https://iwant2study.org/ospsg/index.php/events/883-20190219-sls-hackathon-etd-cpdd

 

I have a tutorial here that details how to add sound to a game.


OSP@SG blog
OSP@SG Digital Library


OSP Projects:
Open Source Physics - EJS Modeling
Tracker
Physlet Physics
Physlet Quantum Physics
STP Book