question about game design

Started by
4 comments, last by graveyard filla 20 years, 1 month ago
i have a question on game design. do you keep the graphics part of the game seperate from the other part of the game? for example, would i make 2 seperate classes callled class Images { int x; int y; int w; int h; }; then class Data { int health; int stamina; int mana; }; or would combine both of them? and do class Entitiy { int x; int y; int health; int mana; }; so do you keep graphical data and actual game data seperate? or do you combine them? im not sure on which is more logical. if you kept things togeather, it would be more organized. but if you kept it seperate, well, i dunno. maybe it would be too much to handle for just one class/set of classes? i guess thats why im asking
FTA, my 2D futuristic action MMORPG
Advertisement
It depends, of course.
on what? when is better to go with one/ the other. discuss
FTA, my 2D futuristic action MMORPG
What I mean is, either way will work, and which you choose depends entirely on your game''s architecture and your own aesthetic preferences. Properly implemented, neither will ruin your design.

Personally, I keep location information along with general data, but I separate out things that are specifically graphics-related.
If you have a class like the Data class, you don''t have to worry about how the object is going to be displayed.

Say I make an object: Data soldier.

I can display the soldier as a sprite in a typical 2D game, a 3D model, or an ansci text character. I can even choose to represent the soldier in some unusual way, like as a playing card or something. The data is independent of the method of display.

If you had the information about how to display the object included in the class, like with the Entitiy class, you would be forcing yourself to display it in one specific way. This would make it more difficult to reuse the object later on.
i wound up doing something like twix described. i have a class that stores x/y/w/h of the images. then i have a class called Data that stored the actual image (pointer to a surface)
FTA, my 2D futuristic action MMORPG

This topic is closed to new replies.

Advertisement