Starting out with Gdevelop 5 for Game Development

After some thinking I decided to go for Gdevelop 5 for my first 2D HTML game ever. Godot engine and Phaser were option too, but since no programming is required when using Gdevelop 5 and engine/editor is open source, I decided to try it.

I finished platform tutorial from their website after downloading and installing the software and my first reaction was to re-skin it but then I realized that I want something more casual and maybe in the long run suitable for Android export.

Using Gdevelop 5 for Game Development


Using Paint.net I created few simple graphics (different color balls, some walls and gradient background) and made one level of Pass the ball game. Goal is to pass to ball to the other side of the screen with single direction movement with hitting moving walls.

Adding events was really easy and fun. Just click Add Condition button and start typing in search field for appropriate action and right event would pop up. Then add action like add permanent force or stop the ball or change X position, hit run button and I'm playing right away.

You can't get simpler than that.

After a while I decided to make things better and I downloaded from  OpenGameArt some cars and trains sprites and some sand background. Pass the ball became Car Against Trains.

Here is the look of first two levels.


Playing difficulty should always gradually grow, so first two levels are easy. I have two different trains on first and second level. Brown train goes from right to left and green train goes in opposite direction. They have same speed. First level is trivial, second is just a little bit challenging. 

Player can move left and right, can stop the car and launch it. Once the car moves up, player can't do anything with it. Car will hit the train and go back to start or pass to the other side and go to next level.


        



Adding Events (Conditions and Actions) in Gdevelop5


There are several events on every level:

- Moving trains at the beginning of the Scene.
- Change trains position on screen out.
- Move Car on key press.
- Car / Trains collision.
- Level finish event.
- Stop the Car on boundaries.

First, let's introduce game objects.


As you can see, Car object and all Trains are bold and italic which means they are set as global objects, they will appear on every level. Background will change from level to level and LevelText will also change. OK, now the events.

Move trains / set scene variables



Each Train gets own direction, GTrain moves to the right with speed 150 px, KTrain to the left with same speed. I have also train with speed 75 on other levels to make things more interesting and I have static Train as obstacle, I'll maybe remove that later when I add more graphic elements.

Scene variable CarMoving is set to 0. This will be used in other events.

Change trains position on screen out



This is simple event. Move (reuse) train when it is out of screen boundaries.

Move car on key press



I'm using CarMoving variable here to prevent user to move the Car once it started going in vertical direction. This is desired choice. I could have done it differently but the game would be much complicated, and I wanted something simpler to begin with.

Car / Trains collisions



This will change later when collision animation is added. Right now Car just re-appears on start position. Again CarMoving variable needs to be set to 0 again.

Level is finished 



When user / player "wins" the level, avoid all trains and get to the other side of the screen, scene changes.

Moving the Car



If key is pressed and CarMoving is 0 means Car is still in horizontal movement only. Down key stops the Car, right moves it to the right, left moves it to the left, obviously. This could be done without Down key action also.

Stop Car on screen boundaries



Finally last event is stopping the Car on screen boundaries.


Again, very simple and straightforward to add events, and fun.

Next are levels 3 and 4. Here is how they look.



Now these are more difficult. Blue train on level 3 has half the speed of green and brown trains. Red train on level 4 is static. It acts as a shield, sort of narrowing playing field for the Car. 

I was thinking of other options too. Should the car be able to move left and right after launching. Can player stop the car once start moving left and right. 

For now there is no animation for the Car. Also background will improve by adding elements like trees, bushes and stones. Music and sounds will be added. 

There are several improvements I'm considering. One is water field which slows down the Car and Ice field which speeds it up. How about a tunnel where Car can enter on the right and exit on the left side of the screen. Also it can go over the train. Possibilities are endless really.

I hope you enjoyed this Introduction and will follow me on my journey. 

Please share this post if you find it interesting.

Thanks for reading.


        


*_* 

Post a Comment

0 Comments