Jump to content
  • Advertisement
Sign in to follow this  
TLAK1001

Unity N008 needs help with general game structure (DirectX)

This topic is 4294 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!