changing luminosity by rgb values.(my tetris game project)

The Partridge Family were neither partridges nor a family. Discuss.
User avatar
viruskiller
Posts: 399
Joined: June 14th, 2012, 5:07 pm

Re: changing luminosity by rgb values.(my tetris game proje

Post by viruskiller » July 8th, 2012, 4:14 pm

thanks,working on sprite loading function now to get fonts and display the score under the shape on the right :D,
kinda wish i did this before coding the frame around the table to be drawn in lines lol(took me a good 2 h to make it)

User avatar
viruskiller
Posts: 399
Joined: June 14th, 2012, 5:07 pm

Re: changing luminosity by rgb values.(my tetris game proje

Post by viruskiller » April 18th, 2015, 7:35 pm

just saw an OOP question a few days on the board, and i know there are some beginners out there still wondering what is all the fuss about OOP , why not just make the thing work and get done with it.
well i was like that, when i made this tetris game, i tryed OOP by making everything inside functions and stuff, but today , after almost 3 years i downloaded the project and tought about improving it.
my idea was to add a Insta_Drop function, so when u press space it intstantly drops the shape, so you don't have to wait 1 second for each shape to settle with the speed thing.
well i've spent like 1 h looking trough my code trying to hack it and make it work, and i just can't.


first i tought i should check for space beeing pressed and while the shape didn't hit bottom yet , just update screen., turns out i wrote the code inside update shape, that is called by update screen, so i went straight into a stack overflow..by recursive function call.
anyway then i took the triger into the draw frame function, and ......well it keeps updating the screen till game over, so when i press space it's insta game over instead of instadrop.....

PS, i had the trigger inside a while loop that is stoped by a clearcheck bool, that should be set to false when a collision happends. the problem is it doesn't happen and it goes gameover.

Chexxor
Posts: 62
Joined: March 12th, 2015, 7:24 pm

Re: changing luminosity by rgb values.(my tetris game proje

Post by Chexxor » April 19th, 2015, 2:42 am

Don't know if you're interested, but I made a Tetris game myself when I went through the beginner series, I posted the game here:

http://www.planetchili.net/forum/downlo ... hp?id=1900

Here's source code if any interest:
Tetris.zip
(2.3 MiB) Downloaded 196 times

Post Reply