My first game (on your phone)
Chapter 1Welcome
This tutorial teaches you how to make a complete platform game, from scratch, without writing a single line of code and right on your Android phone or tablet. At the end you'll have a character that runs and jumps, coins to pick up, a score, an enemy to stomp on, a victory screen… and a joystick and a button on the screen to play it with your fingers.

Along the way you'll get to know the three tools that make BreynGINE easy:
- Sprites: to draw your characters and objects pixel by pixel, with your finger, and animate them.
- Audio: to see the shape of sounds, trim them, make them louder and take their background noise out.
- BreynFlow: to say what each thing does with rules that read like sentences: "When something happens, if something is true, do this".
This is the version of the tutorial for the editor's touch interface: each step tells you which tab to tap and where each button is on the phone's screen, with pictures of the phone.
Chapter 2The editor on a phone
Before starting, a tour of the screen. On a phone the editor shows one thing at a time, and the tabs at the bottom switch between them.



The gestures
- Tap is a click, and tap twice is a double click (it opens folders, files and projects).
- Holding your finger on something is the right click: it opens its menu. For example, hold your finger on an object of the Hierarchy to Rename it, Duplicate it or delete it.
- Pinch zooms the view in and out, and two fingers move it.
- Long lists, menus and rows of buttons scroll with your finger.
- The phone's Back button closes the open menu or window. A menu also closes when you tap outside it (for example, on the strip at the top).
- Tapping a text or a number field shows the keyboard: type and press Enter (✓) to confirm.
Chapter 3Your project
Every game lives in a project: a folder with its scenes, drawings and sounds. Make it in the Project Manager, the screen you see when BreynGINE opens (if you're inside another project: ☰ > Project > Quit to Project List).


The editor opens the scene main, with two objects in the Scene tab: Main, the root of the scene, and Main Camera, the camera that decides which part of the world is seen.
Chapter 4The camera and the color of the sky
We're making a retro-style game, with small 16-pixel drawings. To see them big, we'll tell the camera to come closer.

Now the sky. The background is gray by default; let's make it blue:



Chapter 5Draw the hero
Time to draw. Tap the View tab and slide the workspace bar to the left until you see Sprites. Tap it.


You now have a transparent 16 × 16 pixel canvas. This is how the screen is laid out:
- At the top, the file buttons: New, Open..., Save and, sliding the row, Cut Sheet..., Size..., App Icon... and Add to Scene.
- Below, the tools: pencil, eraser, fill, line, rectangle, ellipse, color picker and select. Slide the row to see the brush size, the mirrors, the grid and the onion skin.
- In the middle, the canvas: draw with your finger. Pinch to zoom and move the drawing with two fingers (if something gets painted when the second finger lands, don't worry: it's undone by itself).
- At the bottom, four tabs: Colors, Layers, Frames and Animations.
Tap a color in the palette (or the color box, for any other) and draw with the pencil. To erase, use the eraser. A trick: draw the outline with the rectangle or the ellipse and fill it with fill.


The animations
A living character moves. We'll make three animations:
- idle: 2 frames, breathing (the second one with the body one pixel lower).
- walk: 2 frames, with the feet in different places.
- jump: 1 frame, with the feet together.
The Frames tab has the frames of your drawing. For the next one, tap Copy (it duplicates the current frame) and change what moves. The onion skin (the last button of the tools row) shows the previous frame faintly so you don't lose your place. Tap a frame to draw on it.
Then, in the Animations tab, tap + Animation and, below it (slide inside the tab), give it its name and choose its first and last frame and its speed. For jump, turn Repeat off.

Tap Save. In the Project tab, sprites folder, you'll find your drawing (player.bsprite), its sprite sheet and its animations (player_frames.tres).
Chapter 6The coin and the enemy
With what you know, draw two more sprites:
The coin: New Sprite... named coin, 12 x 12 (write 12 in Width and Height). Make 4 frames so it spins: the round coin, narrower, edge-on and narrow again. Make the animation spin with the 4 frames at 8 frames per second, and save.
The enemy: enemy, 16 x 16, with 2 frames (squashed and stretched) and the animation walk. Save.


Chapter 7Clean the sounds
A game without sound is half done. Recording a sound with a phone is easy, but there's usually some silence at the start and at the end, low volume and background noise (a hum, the wind...). The Audio editor fixes that.
To practice, use the two sample sounds of this tutorial. The easiest way to get them into your project: with your project open, tap ☰ > Help > Welcome Tutorial and choose Copy and Open: BreynGINE copies them into the sounds folder and opens this page again. (You can also download them here (download the ZIP).) They're moneda_grabada.wav (a coin) and salto_grabado.wav (a jump).
In the View tab, slide the workspace bar and tap Audio. Tap Open..., tap the sounds folder twice, choose moneda_grabada.wav and tap Open.

Take the background noise out
As in Adobe Audition: first you show the editor what the noise sounds like, then it takes it out of the whole sound.


Trim, make it louder and save


Do the same with salto_grabado.wav and save it as jump.wav.
Chapter 8Build the level
Go back to the 2D view (slide the workspace bar to the right and tap 2D). We'll make the ground, three platforms and two walls.
In the Scene tab, tap Main and then the + button. The menu to create objects opens; slide it down to the 2D Game section: objects ready to play, each one with its physics body, its collider and a colored placeholder drawing.



Tap the View tab to see it: pinch to zoom out until you see all of it.

Chapter 9The player
The drawing replaces the blue square and the collider fits its size by itself. The player is already in the group player, which we'll use in the rules.

If you tapped ▶ now, the player would stand still: it doesn't know what to do yet. BreynFlow teaches it.
Chapter 10Bring it to life with BreynFlow
BreynFlow is the way to give orders to objects without programming. Each rule has three parts:
- WHEN: what happens (the game starts, a button is pressed, two things collide...).
- IF (optional): what must be true (it's on the floor, there are 5 coins...).
- DO: what happens then (move, jump, play a sound, disappear...).


Changing the values
The highlighted words in rules can be changed with a tap. Tap the speed and, in the settings that open, set:
- Speed: 120.
- In Look: Idle Animation, Walk Animation and Jump Animation: idle, walk and jump, the names of your animations. The character walks, stands or jumps with the right drawing, and faces where it goes.
To close the settings, tap outside them or press Back.


The jump rule
Tap New Rule again (it's below the last rule) and make this one:
Tap "Rule 1 (click to name it)" and name the rules Move and Jump.
Chapter 11The touch controls
A phone has no keyboard: your player needs a joystick to walk and a button to jump on the screen. BreynFlow puts them there with a single action, and they only show up when the game is played on a touch screen (on a computer everything stays the same).
With the Player selected, in BreynFlow, add one more rule:



Name the rule Touch controls. This is how they work:
- The joystick, on the left: it appears where you put your thumb and moves the player like the arrow keys (Move with the Controls reads it as it is).
- Jump, in the bottom right corner, presses ui_accept: the Jump rule works as it is.
Chapter 12Let's play!
Save the scene (💾) and tap ▶, at the top. Your game opens in its own window, over the editor.
Move with the joystick and jump with Jump. Try climbing the platforms.

To stop, close the game or tap the square ■ of the editor.
While you play, the editor's BreynFlow view flashes each rule that runs and counts how many times it did (▶ 25); if a condition isn't met, it's marked. It's the easiest way to find out why something doesn't work.
Chapter 13The coins
- WHEN: Physics > Collision. It comes ready: "this object touches the group player".
- DO: Change Variable: write coins as the name, tap of the object to make it global (for the whole game) and leave add 1.
- DO: Play Sound: coin.wav.
- DO: Destroy: this object (the coin disappears).

More coins
In the Scene tab, hold your finger on the coin and choose Duplicate. Do it four times. Each copy comes with its drawing and its rules. Spread them over the level with their Position: (0, 12) and (150, -38), on the other platforms, and (-60, 124) and (120, 124), on the ground.
Chapter 14The score and the victory
The coins are counted, but you can't see it. Let's show it.
- Start with no coins. WHEN: Scene Starts. DO: Change Variable coins (global): set to 0. So, when starting again, the old coins don't carry over.
- Show the coins. WHEN: Variable Changes: coins (global). DO: Change Text of this object to Coins: {coins}. What's between braces is replaced by the value of the variable.
- Win. WHEN: Variable Changes: coins (global). IF: Compare Variable: coins (global) greater or equal to 5. DO: Show or Hide: show the Victory text (tap the object, choose An object of the scene... and then Victory); Wait 2 seconds; Restart Scene.

Try the game: each coin adds to the score and, with the fifth, you win!

Chapter 15An enemy
A bit of excitement.
- Walk. WHEN: Every Frame. DO: Walk Back and Forth, speed 40.
- Turn at walls. WHEN: Lands or Hits a Wall (it comes as "hits a wall"). DO: Turn Around.
- Stomped. WHEN: Collision with the group player. IF: Collision Side: the other object came from above. DO: Bounce the other object (the player) with force 260; Destroy this object.
- Touches the player. WHEN: Collision with the group player. IF: Collision Side: from the side. DO: Activate or Deactivate: deactivate the other object; Wait 0.5 seconds; Restart Scene.

Now the enemy walks back and forth. If you stomp on it, you bounce and it disappears; if it touches you from the side, you start again.
Chapter 16Play it and share it
Your game is finished! Save (💾) and tap ▶ to enjoy it.
And now install it as one more app of your phone:
My first game is now in your list of apps, with its icon. With App Icon... in the Sprites editor, your character can be that icon. The APK is kept in the build folder of your project, in Documents: you can send it to anyone.
Chapter 17What next?
You know the basics of the three tools. Some ideas to keep going:
- Add background music: a "Scene Starts" rule with Play Music. It can repeat whole, or only a section, without gaps.
- Make more levels: create another scene and, when winning, use Change Scene instead of restarting.
- Add lives: a global variable "lives" that goes down when the enemy touches you, and the text "Lives: {lives}".
- Explore all the pieces in the BreynFlow finder: timers, messages between objects, save and load game, chase the player...
- Look at View as Code in the rules: BreynFlow shows how they would be in C#, in case you want to start programming one day.
More tutorials
Want more? In ☰ > Help > Tutorials you'll find these, with step-by-step pictures:
- My task list: a phone app with screens, lists, settings and its own icon.
- My invoicing program: a desktop program with clients, products, invoices and PDFs.
- My 3D shooter: a first-person game in the style of the classics, with a level built from shapes, demons, a key and a door.
- My jungle adventure: a third-person adventure in the style of Tomb Raider, in a world of blocks: a generated jungle, a Maya pyramid and a mechanism of stone and plate to open its entrance.
Have fun creating!
