Jump to content
  • Advertisement
Sign in to follow this  
white

need assistance

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

at school i had to learn Pascal i always liked the idea to make things of your own on the computer so i had always 10 rating (out of 10), being the best of my class but i found out that Pascal is a dumb thing that is not used since i can't remember and i started to learn C++ this was kind of surprise to me cause at school we were focusing more on the algorithms, but i liked the templates a lot at oop was my problem, and still is. it is probably the only area of C++ where i had to take everything from scrap i understand anyway now more than the basics but still... i know and the basics of opengl and sdl i wanted to make a tetris game, but i didn't wanted to use a tutorial to do that cause a tutorial doesn't explain the concepts but the makers style of programming i was looking for help at understanding how to do it i want to write it myself from begging to end for example what kind of object would i need and so on thanks in advance hope i do not disturb

Share this post


Link to post
Share on other sites
Advertisement
If someone were to break down the game into classes for you that would imply a specific code layout, which would defeat your purpose of not following any tut, because all it would be is one programmers interpretation. But since you asked...

When you are trying to figure out what objects you need, look at what you are trying to do. You are trying to make a tetris game which is composed of individual blocks, shapes, and a grid. Now that you have broken the game down into its descrete components you can make a Block class, a Shape class and a Grid class. You need to put this on the screen so you'll probably be needing a Window class. You need to get the user's input, so an Input class would come into play. If there is sound then a Sound class. You should get the idea - each descrete object in the design you replace with a class object with the same function as it had in the design.

Share this post


Link to post
Share on other sites
Well this is the part that is entirely up to you. There are many ways you could lay out the guts of your code. At this stage you are basically asking how to put together the game logic, and for that you are probably better off reading a tutorial because its sure to explain it better than I will.

But here's a few hints. A grid class contains everything that is going on in the grid. So that means it needs to know what shape is currently decending. It needs to store an array of all the static bricks. You should probably carry out some of the game logic, like checking for full rows or if a static block has setted above the top of the play area, and other various operations.

But tetris's game logic is fairly straight forward. I would recommend trying to do it yourself, even if the code isn't perfect. Perfect code is over rated. Get the code functional and (mostly) bug free. If the design isn't optimal, who cares? But you will learn more by hacking together a fully working game your self than following a step-by-step guide from someone here or a tut.

Share this post


Link to post
Share on other sites
thanks for assistance
for that idea i posted here
and that is why i don't want to follow a tutorial
but i am very new at working with classes and i am not used to them at all
thank you again

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!