![]() If I typed: s2g.py Terraheads (no arrow parenthesis around Terraheads) I got no syntax errors but it said “NameError: name ‘s2g’ is not defined” I have all of the files that the ReadMe file instructed in the ScratchFoot Master File.Are you in the command line or the Python interactive interpreter? The error message sounds like the latter. First you create a new sound like this: GreenfootSound sound new GreenfootSound ('filename') // the filename is the same as the one you would use in the playSound method You should create this sound as a global one (at the top of your code). Or wihout “python”: s2g.py Which gave me a syntax error under “”. If you want the sound to stop you have to use the class GreenfootSound. I added the file to the sounds folder and even tried it to play when an action is done but both didnt work import greenfoot. ![]() Okay so what I typed was: python s2g.py which gave me a “Synta圎rror: invalid syntax” syntax error under ‘s2g.py’. Hey I wanna add a background music when you are in the main menu but somehow it just wont play the sound. In Greenfoot it works fine, but when I try out the exportet version, it always stops. $ cd path/to/files $ python sg2.py Terraheads2.sb2 TerraheadsReplace “path/to/files” with the actual location to the folder that contains Terraheads2.sb2īookOwl wrote:Can you copy and paste the whole error message? That would help a lot with figuring out what is wrong.First off I have no Idea how to program in python. I want to read out, which sounds are in the sound- folder. : Could not open sound file: themeSong.mp3 at (SoundExceptionHandler.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |