Gamefroot now makes learning even easier with our brand new resources sidebar. After seeing the success of the widely influential Hour of Code and Kahn Academy styled learning areas, we’ve begun stocking our own sidebar full of easy to use learning resources.
By leading students through a set of steps covering both theory and practical application, these resources enable learners to create useful and fun game mechanics with a focus on core learning outcomes.
There’s a fantastic new feature in our editor, it’s an asset of the audible nature: it’s sound and music! We’ve had the code blocks for some time, but no way to add your own sounds, but now that’s all possible. Let me talk you through it.
The first thing you need is a script to trigger the sound to play. Click on “Add new” in the scripts panel.
Next you’ll need to write your script; use the code blocks to create the image below. This script simply plays some music when the object the script is attached to is created.
Save your script, giving it a name and making sure that “The Music” variable has “Public” checked.
Now we’ve got our script, we need some music to play. Open the “Asset Manager” by clicking on “Assets” in the top right of the screen (next to preview). Create a new pack or select one you own and click the “Create New Asset” button. Select “sound/audio” and upload the music you want to use. Here’s a track to get you started;
Once your tracks are uploaded, the only thing left to do is add them to your level! Add a new game object and attach the “Play Music” script to it. Now right click the object and select “Edit Instance Properties.”
Then select the music you want to play from the drop-down;
And that’s it! You’re all set. Hit preview and enjoy the sweet serenade of you’re in-game music. Why not give some sounds a go now? It works the exact same way, the only difference is that multiple “Play Sound” blocks can be played over top of other sounds and the sounds you play wont loop like they do with music. Good luck Gamefrooters!
Hey guys, here’s a quick rundown of how to make something move around with the keyboard.
Here’s a little game I’ve started building. I drew some terrain down, and then placed a snowman (on a regular layer).
I want to be able to move this snowman around by pressing the arrow keys, so I need to create a script. To do this, right-click on the game object, then select Add Script.
First I need to be able to tell when keys on the keyboard are being pressed. We can get the Event block for this under Input, Keyboard. Click on the block “When the player presses key” and drag it out into the empty workspace.
This block comes with backspace selected as the default key, but I want to use the arrow keys. To change the key, click on the arrow next to backspace and select right arrow from the drop down menu.
I want the snowman to move around, so I need to get a block specifically for movement. Blocks for movement and physics are under Game Mechanics, ArcadePhysics. Grab the “set velocity x” block and drag it into the block we placed down before. Make sure they snap together.
A velocity of 0 won’t move at all, so change the velocity x number to 200.
Then Save the script!
Hit Play (in the top-right corner) to see if your scripted snowman works.
Wheee! When you press the right arrow key, the snowman flies off to the right. Perfect. Let’s get the other arrow key working. Click Edit (in the top-right corner) to go back to edit mode.
To keep working on the script we started, right-click on the snowman and select Edit script.
I want the snowman to stop moving when I release the arrow key, so I need to duplicate these blocks. Right-click on the yellow event block, and select Duplicate.
Now we have two sets of these blocks.
Change one of the “presses” to “releases” by clicking on it to reveal the drop down menu.
When the key is released, I want the movement (velocity) to go back to being still. That means I need to set velocity to 0.
Now we can repeat this process to make the left arrow key make the snowman move left. Duplicate the existing blocks, and change right arrow to left arrow. Also make sure you set the velocity to -200 instead of 200. A negative velocity like -200 will move the snowman to the left instead of to the right.
Now save this, and Play the game. Awesome! Now your snowman can move left and right. What else would you add to this script? What other things should happen to the snowman?
If you have any cool ideas, let us know in the comments below.
You may have noticed that your character or other game object was squished when you placed it into your level. This is because you’ve placed it in a Terrain Layer.
Don’t worry – just make sure you place game objects on a regular Layer (this applies to characters, or anything else interactive).
Terrain layers are a bit different to regular layers. Anything that is placed in a terrain layer will be resized to fit the terrain tilemap grid, and anything in that grid becomes solid and won’t move – this makes calculating collisions in your game far easier, and your game will run smoother.
Note: if the game object is animated, it will appear in terrain with the last frame from the last animation sequence (for characters this usually makes them appear as lying down).
If you want your game objects to become terrain, then place them in a terrain layer. Otherwise, place them in a regular layer.
We’re really excited by how well the new version of Gamefroot has been received. Over the coming weeks, we’ll be ensuring all your games from the old Gamefroot are accessible in the new Gamefroot editor at make.gamefroot.com. Once this process is complete, we’ll be taking down the old Gamefroot so that we can focus on maintaining a single game making environment. With that focus, we can continue to make Gamefroot more powerful and easy to use.
We hope you continue to enjoy using Gamefroot. We’d love to hear your feedback, so please send us a message here with your questions or comments.
We’ve been working on a new and improved version of Gamefroot for the past few months, and it’s finally ready to unveil. Gamefroot 2.1 is a quite a change from the older version of Gamefroot.
This new version boasts a brand new HTML5 game engine, a new visual coding editor powered by Google Blockly, and an improved user interface. We’ve taken the emphasis away from forcing our users to make platform games – now you can make any kind of game you want, as long as you create or choose the assets and scripts you need. Gamefroot is now a blank slate, awaiting your command.