ria pc game
translate to English   translate to Chinese
fle game engine - движок для создания игр
fle game engine - движок для создания игр

Balls and holes PC game / Balls and Holes PC игра
16 ноября 2018
Вход Регистрация Забыли пароль ?

megainformatic - Основы 3D-анимации, экспорт скелетной анимации
  [Все уроки 3ds max] [Галерея моделей] [далее]    


создание сайтов, создание игр, дизайн, игры, информатика, уроки photshop, php, c++, музыка, delphi, cms, робосайт

Статьи сайта

megainformatic - Как создать игру ? - Пишем игровой движок с нуля - Общая структура будущего игрового движка


megainformatic - Как создать игру ? - Пишем игровой движок с нуля - DXUTMainLoop - цикл работы DirectX-приложения

megainformatic - Варианты макетов Психолог 911

megainformatic - Шаблоны для сайтов - что это и какие они бывают ?

megainformatic - Ива Ден энд КуХа - КОДЕКС ФРИЛАНСЕРА - Глава 3 - Кто он ? (who is ?)

megainformatic - Мои Музыкальные Миры - готовая музыка mp3 - новинки 2013 года

megainformatic - Теория и практика хакерских атак - самозащита от нападения

megainformatic - Теория и практика хакерских атак - самозащита от нападения - Способы подмены реального IP

megainformatic - Fruity Loops Studio 9 - Как синтезировать свои сэмплы - изучаем возможности плагина Sytrus

megainformatic - Видоизменяем тему для Wordpress под свои нужды

megainformatic - Flash приложения и игры - Шаг 3 - управляемый шарик

megainformatic - Учимся создавать флеш-игры, что нужно знать для того, чтобы заняться созданием flash приложений и игр ?

megainformatic - Шаг 4 в освоении Flash-технологий - как анимировать персонажа и управлять им

megainformatic - Форма для смены шаблонов сайта. Модуль template selector

megainformatic - megainformatic cms express files + module slider

megainformatic - Создание сайта бесплатно или под заказ

megainformatic - Как создать flash баннер

megainformatic - Разработка flash-приложения для сайта: онлайн примерочная

megainformatic - Мои впечатления о книге - Владислав Крапивин - Журавленок и Молнии

megainformatic - Модуль отзывов/комментариев для вашего сайта

megainformatic - Модуль отзывов/комментариев для вашего сайта

megainformatic - Модуль отзывов/комментариев для вашего сайта

megainformatic - Модуль короткие ссылки short link

megainformatic - Работа с сокетами fsocket из php

megainformatic - Как создать игру Создание игровых панелей и индикаторов

megainformatic - Приключения Кости Коробкина - Как я провел лето - интерактивный комикс

megainformatic - Приключения Кости Коробкина - Как я провел лето - интерактивный комикс

megainformatic - Приключения Кости Коробкина - С новым годом - интерактивный комикс

megainformatic - Система управления сайтом на php - megainformatic cms admin files

megainformatic - обзор антивирусных средств защиты

megainformatic - как работает антивирус ?

megainformatic - Создание сайта для бизнеса

megainformatic - Новый взгляд на очевидные вещи

megainformatic - Разработка программ на c++

megainformatic - Немного о музыке

megainformatic - GET и POST запросы

megainformatic - для чего нужна карта сайта

megainformatic - Web Администрирование

megainformatic - Мысли о разном

megainformatic - Легко ли быть программистом

megainformatic - Глубины программирования на C++

megainformatic - Убираем лимит на размер импортируемого файла в PhpMyAdmin

megainformatic - Как создать torrent файл

megainformatic - Нужна ли валидация вашему сайту ?

megainformatic - Антивирус DrWeb

megainformatic - Калькулятор рассчёта стоимости зубопротезирования для стоматологической клиники

megainformatic - Что такое BitTorrent (БитТоррент)

megainformatic - Миссис Даутфайр 1993 фильм torrent

megainformatic - Как скачивать торрент-раздачу ?

megainformatic - Автотелега фильтр

megainformatic - Фильмы

megainformatic - Fahrengeit Фаренгейт игра 2006 для PC

megainformatic - Fez игра для PC 2013

megainformatic - Дневник памяти - фильм 2004

megainformatic - Scooter - The night - Video and Lyrics - Скутер - Ночь - Видео и лирика

Creating game on fle game engine - Simple game / Создание игры на fle game engine - Simple game

4. Coding - Setting parameters for the Scene Editor fge and write code to display the sprite ball in your first gaming application

читать данную статью на русском

This is the most exciting moment - because your future game is born !


page 1 - Sprites

page 2 - Objects

page 3 - Overlay objects

page 4 - Coding - Setting parameters for the Scene Editor fge and write code to display the sprite ball in your first gaming application

page 5 - Show jumped ball

page 6 - Loading game scene

page 7 - Moving game scene

page 8 - Closing of the scene from the cavities by means of a black texture with a slot, restricts the movement of the scene

page 9 - We realize getting into the correct hole and around the holes - holes define the boundaries of sprites and sprite jumped ball

page 10 - Testing collisions

page 11 - Game score, sounds, music

On the previous pages you have read the plan on which we will make our educational game, the fundamentals of its preparation - creating sprites and placement of game objects in the game scene.

But all this would not be if the code does not revive them.

In addition, in the preceding pages I have formulated some questions that promised to answer later.

Now the time has come. Let's start in order.

As I said, for the grid cells in our game the size of 100x100 pixels has been set.

This setting, and as well as a whole series of others can be set in a special file of parameters.

If you open a directory


you will find there a file


in it every parameter is accompanied by a comment, that's an example of the contents of this file.

grid_cell_width=100.0f; //the width of the grid cell in pixels
grid_cell_height=100.0f; //the height of the grid cell in pixels
grid_mode=7.0f; //0.0f - dont show grid, 1.0f - not used, >2.0f && <= 7.0f segment grid, >7.0f - normal grid
grid_color=0xFFA445D5; //the color of the grid lines first pair of numbers FF - from 00 to FF sets the translucency, the other set RGB color
snap_to_grid=1; //0 - not bind the object to the reference grid point by clicking, 1 - bind
info_text_color=0xFFFFFFFF; //color information labels, the first pair of numbers FF - from 00 to FF sets the translucency, the other set RGB color
grid_scroll_speed=50.0f; //speed of scrolling grid and game scene
bg_fill_color=0xFFAEAEAE; //color to fill the background of the empty scene
scene_width_in_cells=20; //width dimension of scene - the number of blocks in width
scene_height_in_cells=16; //height dimension of scene - the number of blocks in height

I think now everything is clear. You can select a file in any of the settings for the size of the cells in your scene, you can also set the color of the grid, view its display - normal or segment, scrolling speed and other.

It should be noted that the settings should be set and save your changes before running Scene Editor fge.

If you want to change them when the editor Scene Editor fge is already running - then you need to save the results of current work and close the program. When to make changes to a file params.txt and run Scene Editor again.

Only after that the new settings take effect.

Creating new scene in fle game engine - in editor of scenes Scene Editor 1.0.2 - scene ready - ball in hole

In our educational game, the ball will have to dodge the holes, the floor should be a move of the mouse movements. Somewhere must be taken into game score and displayed for successful attempts to catch the ball in the hole. Picture the scene, and all game resources must be uploaded to your game app. In the game we will also add 2 sounds - the sound of the ball in the hole successfully catching and unsuccessful, and even the background music mp3.

I will not torment you more waiting, let's start !

The first thing that starts any game programming - is the foundation - starting the initial code that must be taken to leaning on it, to create your new game.

Such a code already present in the distributive of fle game engine and we just take it "AS IS".

Code of my project, I will provisionally call simple game.

You certainly can name your project as you wish.

All we need at an early stage, namely the including of the necessary libraries and header files, configuration files in the project, writing a start-up code - everything is already there and does not need to add anything.

If desired, in the future you will be able to examine what is and what is done to be able to expand without limit your own project. But now we will have to worry at the basis of the following questions:

1) We need to load a scene into our app and show on screen.

2) Load and display the sprite of the ball - because it is not part of the scene and will work on it separately.

3) Learning to control the movement of the scene - so it moved with mouse movements.

4) Implement the occurrence of game situations: that the ball started to move and dodge the holes, as well as check and output them from falling into the hole and accounting game score.

5) It will also be necessary to display the dialed player game score for successful hitting the ball in the hole.

6) Add the sound - the sound of a successful hit the ball in the hole and the sound of a miss.

7) Add background music mp3.

8) Did you have any more additional questions that will have to decide.

To create our application we will use a development environment Microsoft Visual Studio 2005.

For normal compilation and assembly of examples you will also need to DirectX SDK Aug 2008.

To have the opportunity to create you own game on the basis of an example simple_game with unlimited possibilities of further expansion! - subscribe to fle game engine -

Price: 10 usd.

Subscribing to fle game engine You get an example of the game simple_game with source code, and you can not just read everything that will be described below, but do yourself in your own application with the possibility of unlimited expansion. Also, you get

for the latest version Scene Editor fge 1.0.2 (on current moment) with support for more features: grid settings, scrolling, and more. In the free version, these features are not supported. more details about the distibutive of a paid subscription.

Let's start with a simple questions.

2) Load and display the sprite of the ball - because it is not part of the scene and will work on it separately

and display it on the screen.

Let us assume that our project is located in the folder


Then, inside the folder


Create subfolder simple_game, and inside it - ball -


And place inside it the file


I.e our jumped ball

jumped ball

To the application simple game could load the sprite, and his animated show - jumping, you need to create a file inside folder


the file


And enter the following line in it -

ball\jump.tga; -0.7f; 0.1f; 0.909f; 0.5f; 0.5f; 64; 128; 0; 0; 4; 8.0f; 14.0f;

If you've watched utility Coords2D, and tried to run from it any sprites, familiar with the included readme.txt file - it can easily guess that we just define the parameters to load our sprite ball.

If you still do not know anything about the utility Coords2D, I advise you to immediately fill this gap, as the sprites are the foundation of any game, and you need to understand how to work with them.

On this occasion I have written lessons - How animate spider, Animate the wolf from the cartoon.

After reading, you will learn how to create sprites and itself as animated, that is beginning to display their animation in the game.

After the file is created


with the animation of the ball, mentioned above, and save the changes, and now we write the code that will make load our ball, display it on the screen, and not static and animated.

In unit


After line

#include "DXUTsettingsdlg.h"

Adding new code

#include "game_sprite.h"

And after line

double g_fLastAnimTime = 0.0;

This code

CGameSprite g_AI_Ball_Sprite; //the variable that will store the object to work with our sprite ball

Next, you need to do a search on the code module start.cpp and find the line containing


After each found line to insert a - a similar line of code -

g_Splash.Restore(); //this is what you find
g_AI_Ball_Sprite.Restore(); //this is what you need to add

g_Splash.Free(); //this is what you find
g_AI_Ball_Sprite.Free(); //this is what you need to add

g_Splash.Invalidate(); //this is what you find
g_AI_Ball_Sprite.Invalidate(); //this is what you need to add

g_Splash.Anim(); //this is what you find
g_AI_Ball_Sprite.Anim(); //this is what you need to add

g_Splash.Draw(); //this is what you find
g_AI_Ball_Sprite.Draw(); //this is what you need to add

g_Splash.Load(); //this is what you find
g_AI_Ball_Sprite.Load(); //this is what you need to add

g_Splash.NextSplash(); //this is what you find
g_AI_Ball_Sprite.NextSprite(); //this is what you need to add

The task is simple, but requires care. Do not miss out and do not add anything extra, otherwise there will be errors.

Next, compile the application.

If no errors, good. If there is - we read it for mistakes, understand and correct.

We launch our application - this is an executable file -


If you did everything correctly, then after a normal run the application to see on a screen image -

The first start your future game created on fle game engine - we try to bring game sprite for jumping ball

The application runs, no errors. But there is no and no ball on the screen.

There is no mistake, but if you were careful and well understood as the withdrawal of sprites using a utility Coords2D, it can easily fix the problem. This is the same question we touched on page 2 - Objects, when we created our gaming scene. It also dealt with the ball disappearance from view.

If you have any ideas on this occasion you have not, then again I urged to read the utility Coords2D and especially to read the file readme.txt attached to it, run utility and find out how it can help the sprites are displayed on the screen, based on the set for them in the file tex_list.txt parameters.

You must learn to overcome difficulties on their own, without help. Without explicit hints. That's when you can find information, understand it, and actually create games. Creating a game requires a lot of work and effort.

Sometimes simple, it would seem, at first glance, the decision turns out to be useless if you do not know the subject matter thoroughly.

And the fact that it may take to clarify the many, many hours of time. Therefore, what you see is only the tip of the iceberg.

But very few of you will find the strength, and most importantly, the desire to reach the end.

[previous] [next]

megainformatic live chat
Начать беседу

Registered comments

fle game engine - движок для создания игр
fle game engine - движок для создания игр

Something: Unexplained 2 captive of desires / Нечто: Необъяснимое 2 в плену желаний
Костя Коробкин Комикс Коллекционное издание - 6 комиксов, 81 страница, 220 mp3 треков
megainformatic Размещение баннерной рекламы у нас

Время загрузки: 0,0773