Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 11 Vote(s) - 4.09 Average
  • 1
  • 2
  • 3
  • 4
  • 5
(V1.2) Tetris: The dark descent
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#14
RE: Tetris: The dark descent

Thanks for the great responses guys!
Quote: If so, I think grunt sounds for a "Tetris" (Clearing 4 lines at one) would be awesome.
I can add this quite quickly, so sure, why not? There is already a grunt sound if you die, after all Wink.

Quote:TIME FOR PAC MAN
Haha, it would be interesting to see just how far things could be pushed, what had to be done to just make tetris was more work than i originally though.

Quote:Epic! I just got done playing my first game and all I can say is... how?
Quote:Y U NO INDENT
<3
The scripts are a tricky to follow, i will admit that. When I finalised a function (they are loosely coupled from the rest of the code) I compressed it down in vertical space a little so that each line does one "function" (so if I have two conditionals deciding a variable's state, that will be 1 line). This was done to make it less of a hassle when scrolling up and down the code, as it was beginning to take an insane amount of lines. For those who are interested in how different parts were created, though, here is an overview:
Spoiler below!
Drawing:
The game screen is composed of large "pixels" emulated by a box light shining onto a wall with a ceiling texture (chosen as I could alter the tile settings so each "block" of the ceiling fitted in 1 box light). Each score digits are made of a set of 10 lights (digits 0-9) and only one is active at a time for each digit.
The box lights follow the naming convention "col_[x]". Each "0-9" of x represents x coordinate, and the tens represent the y-coordinate. The digits are named "score_[digit]_[placement]" - digit is the number to display (0-9) and the placement is how far along the score this digit is. Leading 0's are chopped off with some array offset trickery.

Blocks:
Probably the most abstract part. Each tetris peice is stored as 4 integers (1 for each rotational state) in an array. The integers themselves are bit-feilds, with 1 corresponding to a "block" taken, and 0 corresponding to empty - this defines a 4x4 block shape in the first 16-bits of the integer. The indexes of the block-pieces in this array match up to the indexes of the colour array (offset 1) for drawing them.
Collisions are done by generating another integer in the same format as the blocks from a large map array (encodemap()), and performing a bitwise-and between the current piece and the map integer.

Movement:
This is the part i came up with first, and what gave me the idea for this "story". The player is (near-pixel perfectly) surrounded by 4 script entities, which trigger depending on where he moves, and then warp him back to the start position. The player-movement speed is reduced to a 1/10th of what it originally was so the "wobbling" is less noticable.
Each script then activates a boolean variable which indicates that direction has been pressed. This is means the peices are then only checked for movement in the right phase of a fixed-speed update cycle, as opposed to whenever, and also lets me delay movement a little so blocks don't zip around uncontrollably.


Also, am working on an updated version, hopefully will be out soon - just depends how hard some scripting is to do.
04-24-2011, 05:55 PM
Find


Messages In This Thread
(V1.2) Tetris: The dark descent - by Apjjm - 04-23-2011, 11:35 PM
RE: Tetris: The dark descent - by Kyle - 04-23-2011, 11:49 PM
RE: Tetris: The dark descent - by Cryaotic - 04-23-2011, 11:58 PM
RE: Tetris: The dark descent - by Russ Money - 04-24-2011, 12:16 AM
RE: Tetris: The dark descent - by xiphirx - 04-24-2011, 12:37 AM
RE: Tetris: The dark descent - by palistov - 04-24-2011, 12:59 AM
RE: Tetris: The dark descent - by Danny Boy - 04-24-2011, 02:28 AM
RE: Tetris: The dark descent - by SkyeGU - 04-24-2011, 04:57 AM
RE: Tetris: The dark descent - by skypeskype - 04-24-2011, 08:48 AM
RE: Tetris: The dark descent - by ZxBrad - 04-24-2011, 04:05 PM
RE: Tetris: The dark descent - by Danny Boy - 04-25-2011, 12:07 AM
RE: Tetris: The dark descent - by Som1Lse - 04-24-2011, 04:40 PM
RE: Tetris: The dark descent - by nofsky - 04-24-2011, 05:08 PM
RE: Tetris: The dark descent - by Apjjm - 04-24-2011, 05:55 PM
RE: Tetris: The dark descent - by Thomas - 04-29-2011, 01:46 PM
RE: Tetris: The dark descent - by MulleDK19 - 04-26-2011, 12:39 PM
RE: Tetris: The dark descent - by waqas12346 - 04-26-2011, 01:02 PM
RE: Tetris: The dark descent - by Yuhaney - 04-26-2011, 01:22 PM
RE: Tetris: The dark descent - by Apjjm - 04-26-2011, 06:12 PM
RE: Tetris: The dark descent (V1.1) - by Apjjm - 04-29-2011, 11:21 AM
RE: Tetris: The dark descent (V1.1) - by Ongka - 04-27-2011, 04:29 PM
RE: Tetris: The dark descent (V1.1) - by Thomas - 04-29-2011, 01:37 PM
RE: Tetris: The dark descent (V1.1) - by Urkle - 04-29-2011, 01:46 PM
RE: Tetris: The dark descent (V1.1) - by Thomas - 04-29-2011, 01:50 PM
RE: Tetris: The dark descent (V1.1) - by jens - 04-29-2011, 02:19 PM
RE: Tetris: The dark descent (V1.1) - by Luis - 04-29-2011, 03:53 PM
RE: Tetris: The dark descent (V1.1) - by Cryaotic - 04-29-2011, 03:55 PM
RE: Tetris: The dark descent (V1.1) - by Acies - 05-01-2011, 01:32 AM
RE: Tetris: The dark descent (V1.1) - by Karai16 - 05-02-2011, 10:42 PM
RE: Tetris: The dark descent (V1.1) - by Apjjm - 05-07-2011, 01:48 AM
RE: Tetris: The dark descent (V1.1) - by w3sp - 05-07-2011, 08:02 AM
RE: Tetris: The dark descent (V1.1) - by bobbo - 05-23-2011, 01:23 PM
RE: Tetris: The dark descent (V1.1) - by Tenno - 05-24-2011, 07:32 AM
RE: Tetris: The dark descent (V1.2) - by Apjjm - 05-28-2011, 02:42 AM
RE: (V1.2) Tetris: The dark descent - by Kyle - 05-28-2011, 03:15 AM
RE: (V1.2) Tetris: The dark descent - by Apjjm - 05-28-2011, 03:20 AM
RE: (V1.2) Tetris: The dark descent - by Urkle - 05-28-2011, 04:22 PM
RE: (V1.2) Tetris: The dark descent - by Kyle - 05-28-2011, 04:31 PM
RE: (V1.2) Tetris: The dark descent - by Apjjm - 05-28-2011, 04:53 PM
RE: (V1.2) Tetris: The dark descent - by Tenno - 06-09-2011, 12:49 PM
RE: (V1.2) Tetris: The dark descent - by yman - 06-27-2011, 12:36 AM



Users browsing this thread: 1 Guest(s)