This site requires JavaScript, please enable it in your browser!
Greenfoot back
Heet_Patel
Heet_Patel wrote ...

2018/1/30

Stopping and playing music

Heet_Patel Heet_Patel

2018/1/30

#
Hi guys, I am actually trying to make a game and the problem is that I want it to start only when I press the Run button in the corner of the greenfoot window. I also want it to stop when I press the pause button. My file is Barking.wav and my world's name is MyHouse. Please write this down in the code if possible.
Heet_Patel Heet_Patel

2018/1/30

#
I also have a scenario that i have created. Please could you tell me what i could improve on.You might need to download and open in greenfoot.
danpost danpost

2018/1/30

#
Create and keep a field reference to a GreenfootSound object for Barking.wav and use the 'started' and' stopped' methods of the World class to control the sound (using GreenfootSound methods on the object).
danpost danpost

2018/1/30

#
You could "Save the World" after adding object to your world (one time) so that they start in the world when you reset the project. They will also show up in the uploaded version then also. You could use different keys for the turtle and the fly (or have one move/turn randomly on its own). Controlling two different actors with the same key just seems a bit weird.
Heet_Patel Heet_Patel

2018/1/30

#
sorry but actually i don't need the turtle. i also would like the music to stop and play when i start and stop the game if there is a possible code for that.
Heet_Patel Heet_Patel

2018/1/30

#
Also is it possible to put the walls in a particular places
Heet_Patel Heet_Patel

2018/1/30

#
in some kind of code like setting its spawn location
Heet_Patel Heet_Patel

2018/1/30

#
also i updated the game so please could you like use that and tell me the code
Heet_Patel Heet_Patel

2018/1/30

#
thanks though. and do you have a youtube channel on coding for greenfoot
danpost danpost

2018/1/30

#
Heet_Patel wrote...
thanks though. and do you have a youtube channel on coding for greenfoot
No -- just the two tutorials uploaded here. Most of your other recent posts were answered by my last post (without code -- but quite straightforward). The walls also can be set when you save the world.
You need to login to post a reply.