Spank the monkey!

Community Forums/Monkey Talk/Spank the monkey!

gerald(Posted 2015) [#1]
Hi,

I keep trying and all I get is null access error for the moving ball in box, boing.png, program.

I am reading the pdfs and stuff. The data folder the game creates is confusing me. Is that where I put my picture or do I create my own, game.data? Where does it go if I make my own?

Gerald


steve_ancell(Posted 2015) [#2]
When you create your source file, let's call it "MyApp.monkey", you should also create a folder in the same directory called "MyApp.Data". You can then put your images, audio, and level data inside Myapp.data or you can create subfolders within that folder and put stuff in there.

When you compile it will create another folder in your project's root folder, what ever appears in there is what you distribute. You may notice that as you add more stuff inside MyApp.data it also copies that stuff into the subfolder "data" inside the other folder that has been created by the compiler. The compiled application inside the folder that's created by the compiler uses stuff from inside it's data subfolder, anything inside MyApp.data is read by the compiler.

I hope that's easy to follow. ;-)


skidracer(Posted 2015) [#3]
The data folder the game creates is confusing me. Is that where I put my picture or do I create my own, game.data? Where does it go if I make my own?


No put images in your boing.data folder. For each different target you build monkey will copy from your folder to the build folder.

See %monkey%/bananas/mak/bouncyaliens as a starting point and examine it's folder structure before and after you build and run it.


BlitzSupport(Posted 2015) [#4]
Frankly, I wouldn't worry about the build folder at this stage.

Just create yourprogram.monkey and a folder called yourprogram.data alongside each other, then place your sounds and images in yourprogram.data.

To load an image, just do LoadImage ("boing.png") -- assuming boing.png is in yourprogram.data.