Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A Challenge!
#1
So in response to daves challenge, ill offer a little help.

This is what im using for the image handling in my C++ Tetris, feel free to try to figure it out till my example is done.

http://www.kingdomofcryshall.com/CImg.h

yes, indent = 2 spaces, blame verr for getting me in the habit.
Reply
#2
grimsk8ter11 Wrote:So in response to daves challenge, ill offer a little help.

This is what im using for the image handling in my C++ Tetris, feel free to try to figure it out till my example is done.

http://www.kingdomofcryshall.com/CImg.h

yes, indent = 2 spaces, blame verr for getting me in the habit.

He did the same to me!!!
Reply
#3
How many pieces should it have ?
Reply
#4
mine is random, i am using CImg to generate blocks in random shapes with certain limits (ie. no more then 5 squares, no less then 2).
Reply
#5
Okay.. Willyou do it so you can flip them 90degrees?
Reply
#6
Okay.. well I will probably dosome kind of entry .. meantime you can check my old game bouncing ball which is somehow related to tetris:

hmm.. cant find the url... I will post it when i get home..
Reply
#7
CImg has a function for rotating images, so the up and down keys will rotate. I'll try to find an example code using CImg for people who want to learn C++ a little better, but it is rather complicated.
Reply
#8
Is this a contest?
Reply
#9
Yeah, well I will do my thing in VB, so i'll figure something out.
Reply
#10
can we make it crude and use picturebox's/ simple collision detection?
Reply
#11
I dont know the first thing about direct draw -embarassed-
Reply
#12
Well you can basicly just use "shape" objects, thats the easiest way. I might blit images.. not sure yet..
Reply
#13
I just got into winxp(I was using 2k) so I'll do this later, but I will! I think DD will look better and I'll use VB couse I never worked w/ GFX in C++(but I can make a text Tetris, like a DOS Tetris xD).
Reply
#14
Thats why I rarely come here now because I was just copy-pasting so I decided to make my game from scratch... and .. its hard xD
Reply
#15
from scratch is hard but its way more rewarding. Also doing so you really learn the language and you can actually add stuff in and make a real good game. I will give this a shot if I can but I will need to look at some vb tutorials first cause i Know this is above what I know.
Reply
#16
Working on it right now, but I'm having a bit of trouble thinking about how I'm going to do the blocks. I was thinking of generating 4 random 32*32 blocks and linking them up together randomly, but aren't there any better ways?
Reply
#17
Well at the moment Im only using squares and rectangles, the thing Im having trouble with is to remove the bottom line, and removing a row of a shape and leaving the other part there. hehe

.. so Im in big troubles, I think I will investigate another way to fix this..
Reply
#18
Tetris is actually pretty hard, compared to pong/asteroids/frogger/any oldtime game.
Reply
#19
Not working as it should... try it... I tryed and failed coding it =/

Download Source: http://www.filesend.net/download.php?f= ... b53bcec61e

Image:
[Image: tetrisfu3.png]
http://img182.imageshack.us/img182/8448/tetrisfu3.png
Reply
#20
Basically all it is is having a Type per shape, creating the different shapes before hand. Then, have code checking if the different lines are completed, if they are, go through all the shape's that partake in that line and edit some of the type accrdingly. You can then use BitBlt or BltFast to create the shapes depending on what bits are missing and so forth.

Of course, it is probably much harder in practise... but I don't have time to do the challenge Sad Damn Math's revision...

Grrr... damn GCSE's *growl*
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#21
Awesome, I guess I'll try a tetris clone tonight as well.. Sounds like a cool challenge!
Reply
#22
Yeah, but it was more difficult that I thought in the begining. I might create a new one. And hopefully that one will work.

And the download above is the source code.
Reply
#23
I guess I'll start a Java one Smile.

But you guys have a head start Sad.
Reply
#24
How many slots are there normally vertically and horizontally?
Reply
#25
I set it to 30x60 xD
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)