Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / some code for tetris

Author
Message
SAnTA
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location:
Posted: 3rd Aug 2004 04:40
Ok, so i have been browsing these boards for a while, everyone has been great, and very helpfull, thought it about time i gave something back.

This is the code to tetris, its slighty sloppy as im still a newbie, but this is all the process of learning.

The game plays well and as far as i can see is bug free.. I havent provided no media, as the code is now it loads the following 3 images.

C:\back.bmp - 640 * 480
Background image

C:\bar.bmp - 240 * 20
White image, ya will never see this in game, its just used for collision detection

C:\tetris_tiles.bmp - 160 * 20
This is the last image containing 8 20*20 boxs used to make the tetris shapes from. Black is set as transparent colour so if you want to use otherwise then ya best change the code

I have removed the music code, Hope this is of use to someone



Enjoy
SAnTA
SAnTA
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location:
Posted: 3rd Aug 2004 23:13
34 views and not one comment, HUMPh, Not even to tell me it sucks ((SULK))
Kohaku
20
Years of Service
User Offline
Joined: 3rd May 2004
Location: The not very United Kingdom
Posted: 3rd Aug 2004 23:18
Know how you feel.

I have to say, I dislike tetris with a passion. However a new dude can learn alot from the code. I gained an idea of arrays thanks to a tetris game in the 20 liner section.

Good one.

Infra-Dark
#coding, like coding, but with a #
http://www.knova.dbspot.com/
Hell Dragonz43
20
Years of Service
User Offline
Joined: 27th Jul 2004
Location: at home or at work
Posted: 4th Aug 2004 13:56
Sorry, i cant compile it cause my g-card is screwed up. But from the looks, it looks awesome!
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 4th Aug 2004 22:22
So, would a sprite be regarded as settle if you had a L-shape like
---+
|

on top of a block (ie there would be a space between the block and the L shape) ? If so, then that could be a problem...


Come to the UK Convention on the 23rd & 24th of October
SAnTA
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location:
Posted: 4th Aug 2004 23:14
sorry TCA, i dont understand the question :S
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 5th Aug 2004 07:33 Edited at: 5th Aug 2004 07:36
Say the L shape is 24 x 16, and its coming down on top of something - the spaces in the L shape would make it appear there is a gap when there shouldn't be...

I'll do a graphic tomorrow...


Come to the UK Convention on the 23rd & 24th of October
SAnTA
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location:
Posted: 6th Aug 2004 06:57
all the pieces are made up of 4 locks then moved together, it works fine anyway spent a while testing it

Login to post a reply

Server time is: 2024-11-23 19:33:14
Your offset time is: 2024-11-23 19:33:14