Sign in to follow this  

Unity N008 needs help with general game structure (DirectX)

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello GameDev community. I am currently planning out my first video game. I have hit a wall with setting up my sprites. I have a class for each object (Player, bullet, rocket, enemy, etc) derived from a sprite class that holds some general data (position, movement, animation, sprite source, etc). Each sprite is a texture drawn on a 2-d square. I have loaded vertices into my vertex buffer for squares the size of the player sprite, the size of the bullet sprite, etc etc. Then I put the address of the square into the sprite class and render the appropriate square (after transformations) with DrawPrimitive(), using the index value as a start value. That way I can graphically create as many instances of one object as I please with only one set of vertices per object. Is this the way to do it? How do "real" video games do things like this? Thanks in advance for your help, tlak

Share this post


Link to post
Share on other sites
That sounds fine to me; your design seems fairly well thought-out, and nothing sounds obviously wrong with it.

I wouldn't worry too much about the way that 'real' video game programmers do it, if there is such a thing.

Unless something in your design is seriously limiting, unsafe, or results in a measurable loss of productive time, I wouldn't change it.

You can code something that works well enough (give or take a tweak or two) in a reasonable amount of time, or you can spend countless hours designing the perfect system for your game. The latter is fun, but largely unproductive, and I recommend you steer clear of it [smile].

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this