Jump to content
  • Advertisement
Sign in to follow this  
BrianTheLlama

Resource Handling

This topic is 4900 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

I'm currently developing a Tetris-style game. This isn't my first project, as I've completed several other games (including another Tetris clone) before but the project is more focused on understanding the structure of a more developed game. I'm currently struggling with resource management. I've divide all the game logic into a LogicServer class, but I need to access the "shapes" of the falling tetriminos, presumably from some form of global resource pool. Could someone please give me an overview of how this is implemented? Adam.

Share this post


Link to post
Share on other sites
Advertisement
Ah, a local!

Personally I would just use some sort of global to begin with. Then I'd migrate it into a class later. There's not really any right or wrong, just ways that make it easier for you and ways that make it harder, and they in turn really depend on what exactly you need to achieve.

What're you concerned with representing; the types of tetramino, or the instances? Personally I would probably discard individual tetraminoes as soon as they settle, so really you only need to store 1 at any one time, plus maybe 1 more if you have a preview or something.

I tend to have a Game class; anything specific to the game can usually be a member of that class. I don't go in for any complex resource management until I know I need it. I don't think I would need it for Tetris.

Share this post


Link to post
Share on other sites
Hi!

This is a local forum for local people... :P LOL

I'm actually concerned with storing the types of tetrimino more than particular instances.

Within my logic server I hold a copy of the currently active tetrimino and the next to spawn, when a block settles it's amalgamated with the game matrix and the next block is copied to the current tetrimino. I then need to spawn a randomly chosen block from the resource cache into the "next" holder.

I'll give your ideas about a global resource pool a shot, and use what I learn from that to turn it into a server!

Thanks

Adam

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!