Home Made Tetris
- Peregrin_Tuk
- Posts: 9
- Joined: June 23rd, 2016, 7:09 pm
Home Made Tetris
Hi Everyone, I'm practicing programming and this time, I made a Tetris using Chilli's Framework... It took me some time to finish it, but I think it works in a pretty decent way... I just wanna to share it with you...Bye!
- Attachments
-
- Home_Made_Tetris.rar
- (520.25 KiB) Downloaded 142 times
-
- Posts: 432
- Joined: September 26th, 2013, 4:57 pm
- Location: Kentucky
- Contact:
Re: Home Made Tetris
Awesome stuff.
PM me if you need to contact me. Thanks to all the helpful people on this forum especially to Chili.
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: Home Made Tetris
Ah, tetris, hours of my life I want back...
I'm surprised the code actually compiled. You only included the files in Game.h, just can't figure out how the other files knew about each other. It must be because you only use header files and no CPP files. I was messing around and tried moving the definitions to the cpp files, but then started getting errors left and right saying that things were undefined. It's usually a good idea to have the function signatures in the header while putting the implementations in cpp files, but it does require a fair bit of extra work trying to not create circular references.
I'm surprised the code actually compiled. You only included the files in Game.h, just can't figure out how the other files knew about each other. It must be because you only use header files and no CPP files. I was messing around and tried moving the definitions to the cpp files, but then started getting errors left and right saying that things were undefined. It's usually a good idea to have the function signatures in the header while putting the implementations in cpp files, but it does require a fair bit of extra work trying to not create circular references.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
Re: Home Made Tetris
Yeah, when you do it with only .h files, it can compile fine as long as the headers are included in the right order. It's safer to include everything the header uses in the header itself of course.
Personally, I often just use .h files. Less time wasted shifting between .h/.cpp files. Can become a problem in large projects though, where compile times can stack up.
Slick looking game man, good job! The code is really clear and simple to understand. Good use of containers.
Tetris is on the list for games to cover in the series.
Personally, I often just use .h files. Less time wasted shifting between .h/.cpp files. Can become a problem in large projects though, where compile times can stack up.
Slick looking game man, good job! The code is really clear and simple to understand. Good use of containers.
Tetris is on the list for games to cover in the series.
Chili
-
- Posts: 197
- Joined: August 4th, 2016, 10:05 am
Re: Home Made Tetris
hmm if i try and do release mod x86 my antivirus quarantees it? dont get why, and dose not run in debug mode x86 ether? only runs in 64x debug/release
this is the error i get in debug mode x86
1>c:\users\freebattie\downloads\home_made_tetris\kill_the_aliens\engine\score.h(411): error C4703: potentially uninitialized local pointer variable 'list_to_travel' used
this is the error i get in debug mode x86
1>c:\users\freebattie\downloads\home_made_tetris\kill_the_aliens\engine\score.h(411): error C4703: potentially uninitialized local pointer variable 'list_to_travel' used
- Peregrin_Tuk
- Posts: 9
- Joined: June 23rd, 2016, 7:09 pm
Re: Home Made Tetris
That's because "travel_ list" is initialized inside a switch statement. Was my mistake to not initialize it as null_ptr when declare it. The error is thrown because in case none of the conditions inside the switch were true you will be accessing undefined places in memory.
-
- Posts: 197
- Joined: August 4th, 2016, 10:05 am
Re: Home Made Tetris
yeah ok that fixed it
EDIT: but my antivirus still dosent like it in x86 release mode lol
EDIT: but my antivirus still dosent like it in x86 release mode lol
Re: Home Made Tetris
Hey Peregrin_Tuk,
Your Tetris game is really awesome! I was also curious about some of the extra art pieces in the build - Kill the aliens. Were you originally going to make this a Space Invaders type game, but then switched over to Tetris?
Awesome work.
Your Tetris game is really awesome! I was also curious about some of the extra art pieces in the build - Kill the aliens. Were you originally going to make this a Space Invaders type game, but then switched over to Tetris?
Awesome work.
- Peregrin_Tuk
- Posts: 9
- Joined: June 23rd, 2016, 7:09 pm
Re: Home Made Tetris
Thanks Warnakey. First I was about to create some classic shooting game, but I leave the project and a couple of months later I was in the mood to make a simple game and it came to me the idea of tetris... I just used that old folder and didn't find a way to change the name of the containing folder without having problems to compile the project..