Euro Destruction

We'll be pulling together a series of video tutorials to help you get the most out of Thinking Worlds in this forum

Euro Destruction

Postby Blacky » Mon Aug 22, 2011 11:09 am

Hello everyone,

This is advanced tutorial based on this one - Main logic is the same, but a lot of additional stuff added with some corrections.

Furthermore, in this game we are not using only one 2D plane for our background, instead we are going to use several images to create more realistic environment. This will allow us to make a lot more interesting movements of the targets. ;)

Ill3D.jpg
Ill3D.jpg (97.2 KiB) Viewed 931 times


********************************************************************************************************************************************************

Assets and Camera:

Assets:

First, we need to create all objects from the images, for this we will use Image Model Builder, it's included in all Thinking Worlds installations.
All objects in this game are made of simple 2D images.

:arrow: Animated characters are made of sequence of 2D images combined in one object. This feature - Billboard will be available in Thinking Worlds 3.5.3 :!:

When we have created all objects and added them to the scene we are able to begin.

********************************************************************************************************************************************************

Camera:

Camera placement is the same as it is in Cowboys Shooter Game.

Whole section which is covered in red will be visible to us in the game.

CamView.jpg
CamView.jpg (60.89 KiB) Viewed 931 times


********************************************************************************************************************************************************
Blacky
 
Posts: 6
Joined: Wed Jul 06, 2011 9:45 am

Re: Euro Destruction

Postby Blacky » Mon Aug 22, 2011 11:31 am

********************************************************************************************************************************************************

Markers:

Targets & Power-Ups:

In this game we have 6 buildings.

In the spaces between the buildings we are able to hide our characters, also this will allow us to create a lot more interesting movements. :!:

All is simple as it was, you just need to place some markers, and then in the game-logic create movement from one marker to another.

After all, I came to these positions:

Markers.jpg
Markers.jpg (94.52 KiB) Viewed 928 times


Some of the markers are behind the buildings.

Red - is for targets.
Yellow - is for Pick-Ups
Blue - these markers were used during introduction. (not all of them in the latest version) :roll:

Movement Directions:

This screen-shot is showing directions for each object type (targets, pick-ups):

Directions.jpg
Directions.jpg (108.21 KiB) Viewed 928 times


There are a lot of possible combinations. :roll: I covered only small amount, which I've used.

********************************************************************************************************************************************************
Blacky
 
Posts: 6
Joined: Wed Jul 06, 2011 9:45 am

Re: Euro Destruction

Postby Blacky » Mon Aug 22, 2011 12:07 pm

********************************************************************************************************************************************************

Game-Logic:

Alright, we have done a lot of preparation work: camera, background, markers - all done.
Now it's time for the logic, and how this game works.

The logic is done in modular design - it means that all systems are responsible for them-selfs. :)

GL.jpg
GL.jpg (49.46 KiB) Viewed 927 times


Short Description: First, we want to select our Camera. Then we are turning Off the player controller, in this demo we just don't need any controls except the mouse. Afterwards we are checking if the game was launched first time. If yes, then do some initialization work and then do some HUD and Game introduction logic. If not, then skip all introductions. After all, all modules (e.g. spawning the targets, pick-ups, timer, bullets HUD and reloading and so on...) of the game are up and running.

As you can see, this logic can be simplified, this is because firstly the logic was created to allow us to restart the game with "Jump To N scene" node, but this approach took about 1 minutes to reload the scene (game). So, later play again logic was created without this node.

Before we continue, we should have several variables created, they are needed for power-ups, timers, stats and the game itself.

Variables:

A lot of variables just keep tracking our bullets value, debt score, game score, the time, any pick-up if it is enabled or disabled and so on.

********************************************************************************************************************************************************

Game-Logic Groups:

"Main Menu" this group is used for the main menu in the game. It just showing us a background and a button to start the game.

"Initialization" this group is used for almost all game HUD, variables and objects initializations.

By default we should Remove from the scene all HUD and in-game objects.
Also, all variables should be initialized to their default values.

"Bullets HUD & Reloading" in this group we are doing all work with Bullets HUD and Reloading.

It consists of two loops, and they are connected with each other and before each loop we initialize "Bullets" variable. When we have no "Additional Ammo" power-up small loop will be used, either bigger one.

Loop itself have many interconnected "Bullets" variable tests, and when we have small amount of bullets than before it hides corresponding HUD Bullet image. When we have 0 bullets it's showing HUD Reloading Text. Always after each cycle it tests the "Reload" button, after that we test have we or not "Additional Ammo" power-up, and if yes, then loop should be switched to another one.

"Timer" group consists of very simple game timer, and 2 variable tests. One is testing "GameTimer" and if it equals to 0 then it's The End. Another one is testing "TimeStop" variable and if it equals to 1 it means that we have Time Stop power-up, and timer should be paused for 10 seconds.

"Decor - Clouds" group have one loop, at the beginning of the loop we are adding some clouds to the scene, moving it to its default position marker, and then we have a random event node, we use it to randomly choose the speed.

"Game-Play" consists of 3 groups: "Targets appearance", "Power-Ups appearance", "Clicked? If yes, destroy this object", OnlyMiss Pick-Up, StopSpawn Pick-Up.

"Targets appearance" and "Power-Ups appearance" are very similar, they just have several "Random Event" nodes used to choose where to spawn the target or power-up, what direction and speed should be used.

"Clicked? If yes, destroy this object" group is just a loop to test if an object was clicked if yes then test for "OnlyMiss" power-up, after this we need to test the bullets. Then if the player have shoot anything then play some random sounds, add some points, or enable a pick-up, and destroy the object.

"Debt Arrow HUD" and Bullets HUD & Reloading groups are working pretty much the same. Inside them we have a loop in it we are checking bullets count variable value or debt score value and then correspondingly changing the HUD elements. It's very easy to understand, you just need to look through the logic. ;)

Scoring System group is checking what debt value we have, and then it is calculating the game score value as needed.

The End group is responsible to display one of three in-game endings, what ending HUD to show depends on the debt value. Then we are testing if the "Play Again" button was pressed, if yes then restart the game. :)

********************************************************************************************************************************************************
Blacky
 
Posts: 6
Joined: Wed Jul 06, 2011 9:45 am


Return to Tutorials

Who is online

Users browsing this forum: No registered users and 0 guests

cron