Loading a game...

Started by
1 comment, last by Link 19 years, 6 months ago
I'm making my game without use a game editor. Stop with Quake editor, Quake files and so on! I Hate Quake. :) I want make simple 3D game, simple terrain with some object (items, obstacles to go around or jump). I don't think i need a game editor to make this simple world. After i make all my objects separatly with 3dsmax (also the terrain) now i must create the first world. Assume i don't want the animation for the moment how can i load all the objects? 1) Terrain 2) Sprites (items, obstacles) 3) Hero (my character) it is the right way? How can get collision with the item (for example?). Yes using bbox but every frame i can loop my hero with all the items inside the game and know if there is a collision. Isn't it? If it is an item (i tell that just when i load it putting inside VALUE object the int 1, for the obstacle 2 and so on...) So if there is the collision i get the item, i unload it from the game world and i increase the hero bonus. Can you confirm all that? I want make the simplest 3D game. Then when i load the meshs i need to calculate the bbox, but forst i heve to do anything else? scale, rotate, fit to world coordinates or what? For a simple game i need to create lights? TNX!!
Advertisement
Hi Link,

you could write a text file with a list of your mesh files. Then write a levelloader class which loads the file and parses the mesh file names. Load a mesh file and put it into a dictinary, so you could check if a the file is already loaded when it is a second time in the text file.
Start to put additional information in your text file. These could be position information or any thing else you need (e.g. scale, rotate).

e.g.
mesh1.x {2,3,5}
mesh2.x {-10,4,-1}

Make a container with all your loaded items. The container should hold objects of a class that has a draw and a handle function. In your game loop, call the handle function of every object in the container. The collision checking happens in this handle function. The player checks collision with the terrain and moves regulated by the collision. The enemies are checking collision with player. If an enemy is neer the player, a collision happens. So the enemy sends a message to the player informing about the collision.

good luck,

atem
Anyone?

This topic is closed to new replies.

Advertisement