(1) You cannot use aySound method You can only control the volume of a GreenfootSound object. So just to make sure i put that code in my Settings world. Public boolean onWall() // test to see if the man class is on the wall classĪctor Wall = getOneObjectAtOffset( 0, 0, Wall.class) Īctor Door = getOneObjectAtOffset( 0, 0, Door. However, here are some things to keep in mind. Im trying to have a button that mutes all of the sound effects above. You have aysound ('fallenthing.wav'), It should be aySound ('fallenthing. However, as far as fields are concerned, I feel that since they are an integral part of a class, they should be included in auto-completion. I agree that maybe some things should be allowed to be turned on and off. SetLocation(getX(),getY()+1) // move downĪctor Fire = getOneObjectAtOffset( 0, 0, Fire.class) Greenfoot can be used to create quite powerful things, after all (all the 3D stuff thats on here, for instance). SetLocation(getX()+1,getY()) // move Right SetLocation(getX()-1,getY()) // get loaction of x and y, then move -1 on x move Left A GreenfootSound loads the audio from a file. In the Component 2 exam of the WJEC / Eduqas 2016 specification, an audio file will be placed in the sounds folder already. * the 'Act' or 'Run' button gets pressed in the environment.ĬheckKeyPress() // call this method to work Represents audio that can be played in Greenfoot. Sound files must be placed the sounds folder of your Greenfoot project to be used in the game. Import greenfoot.* // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) Is there a way to add a sound based on an object class that you land on? and that it will only play every 5 seconds ? so far I got it to play when I'm on the object but it plays so fast.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |