Public Group

# i'm a beginner so

This topic is 4899 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

i just can't imagin how does a game come 2 life well i mean i have a model the hero which will be the main carachter and i have the land or a room how 2 add the charachter to the room and make it walk in the room or by other means what do i use 2 make this , let's say a one room demo which the hero will figh a liitle boss or just walkin or gettin out of a his cell remember a totally beginner who 's askin thanks

##### Share on other sites
Well, first of all, just doing that might be a lot of job for someone who never did anything like that.

It's depend how you want the game or your "demo"

in 2d? in 3d?

What programming skills do you have with all the languages you know or the language.

If you are interested in doing such a thing, you might want to start with a 2D game.

##### Share on other sites
It comes to life using "algorithms". Step by step instructions telling the computer what to do.

##### Share on other sites
You draw a picture for your charcter. But the algorithms make them move.

A algorithm to make your character move when an arrow key is pressed :
1. erase the character from the screen(or else you'll have 2 characters on the screen)
2. redraw the character 1 space over ( in the direction the arrow key was pressed)

The monsters that the character fights will have to move on their own. So they will have some different algorith that controls their movement, independant of the arrow keys the player presses. Maybe some stupid monsters that just moves back and forth forever would use this algorithm:

<game loop>
1. if monster is in left positon, then move to right.
2. if monster is in right posisiton, move to left.
<end game loop>

You would need some sort of timer for the monsters. The game would need a unit of time sort of. Like a game loop. The program will pass over all the instructions in the game loop forever over and over again. Each pass of the game loop is sort of like a moment in time in the virtual world. And the monster will just keep chanigng spaces every time unit or "game loop".

You'd write the algorthims using a programming language like C++, Java, python, C#, Visual Basic, ect.

##### Share on other sites
Might not be very clear what i typed about the monster and the game loop.

Just in case you don't know what a loop is, it's a group of instructions that get executed repeatedly forever. Or until some condition is met and they stop getting executed.

<begin of loop> (once you do these instructions, do them again.)
1. do stuff
2. do stuff
3. do stuff
<end of loop> ( here you go back to the top of the loop, instruction 1)

The game loop can be thought of as the passage of time in the game. Each loop pass the monsters will check to see what's around them, and then move. They will move differetnly depending on what's around them. Each loop pass you check to see if things have collided with each other. Has your sword touched the dragon? If it has, dragon's health points are reduced.

There are algorithms for checking to see if things have collided. If your game is tile based (sort of like a grid of squares that your hop to each time you move) then collisions are easy to detect. If the square that your moving to has a monster in it, then you've collided. But if your game is more like the real world with infinite little positions, then you must use more complex algorithms (that are also slower).

##### Share on other sites
Tiba, it's quite difficult to explain without knowing how much experience you have in programming. It takes quite a high level of experience to understand how everything fits together in a game. (In fact there are many ways to do it, including FSMs, an Entity Message system (described in Game Programming Gems 2 I believe), simple class based linear structure used by beginners, etc)

Basically, each object in a game is updated regularly in a cycle. Each loop of the cycle alters the data of the entire game and presents it to screen.

A typical game loop might look something like:

Begin loop
Update input
Update AI
Update physics
Update misc items
Handle game logic
Render to screen
End loop

There would be provisions made for other items, such as networking, as well. But the actual structure of this loop varies considerably from project to project, depending on the programmers.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 31
• 16
• 11
• 10
• 12
• ### Forum Statistics

• Total Topics
634116
• Total Posts
3015598
×