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
ZxBrad Offline
Member

Posts: 140
Threads: 29
Joined: Mar 2011
Reputation: 0
#11
RE: Tetris: The dark descent

TIME FOR PAC MAN

WARNING: Noob Doesn't Know How To Script.
[Image: xcn384.gif]

04-24-2011, 04:05 PM
Find Reply
Someone else Offline
Member

Posts: 183
Threads: 9
Joined: Sep 2010
Reputation: 0
#12
RE: Tetris: The dark descent

Totally incredible.
04-24-2011, 04:40 PM
Website Find Reply
nofsky Offline
Senior Member

Posts: 423
Threads: 13
Joined: Sep 2008
Reputation: 1
#13
RE: Tetris: The dark descent

This looks awesome! I can't wait to see how you did it...
04-24-2011, 05:08 PM
Find Reply
Apjjm Offline
Is easy to say

Posts: 495
Threads: 18
Joined: Apr 2011
Reputation: 51
#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 Reply
Danny Boy Offline
Posting Freak

Posts: 2,718
Threads: 85
Joined: Mar 2011
Reputation: 81
#15
RE: Tetris: The dark descent

(04-24-2011, 04:05 PM)ZxBrad Wrote: TIME FOR PAC MAN

i know what is going to be the "ghostssssssssssssss" Big Grin
04-25-2011, 12:07 AM
Website Find Reply
MulleDK19 Offline
Senior Member

Posts: 545
Threads: 21
Joined: Jun 2009
Reputation: 10
#16
RE: Tetris: The dark descent

Good job.

Though, that's the messied code I've ever seen.

[Image: 16455.png]
04-26-2011, 12:39 PM
Find Reply
waqas12346 Offline
Senior Member

Posts: 352
Threads: 38
Joined: Nov 2010
Reputation: 1
#17
RE: Tetris: The dark descent

I posted your story in my thread Big Grin
http://www.youtube.com/watch?v=SgXOcw-6OxM
(This post was last modified: 04-26-2011, 01:05 PM by waqas12346.)
04-26-2011, 01:02 PM
Website Find Reply
Ilkka X Offline
Hello Friends!

Posts: 3,455
Threads: 100
Joined: Mar 2007
Reputation: 64
#18
RE: Tetris: The dark descent

+1 vote for Pac-Man. Tongue

04-26-2011, 01:22 PM
Website Find Reply
Apjjm Offline
Is easy to say

Posts: 495
Threads: 18
Joined: Apr 2011
Reputation: 51
#19
RE: Tetris: The dark descent

Version 1.1 is out. This one permits saving to maintain a highscore, and fixes a couple of bugs. Also added a grunt sound for knocking 4 pieces out at once, as was suggested by Russ Money. Code is as messy as ever though, but there always has been some indentation (or at least should be?). Anyway, this project should be finished now, aside from perhaps a bug fix update if any get found.

In other news, I think I may have an idea for my next project (a rather large undertaking) and it is going to push scripting much further than this did. Got a lot of things to test first, though.
(This post was last modified: 04-26-2011, 06:15 PM by Apjjm.)
04-26-2011, 06:12 PM
Find Reply
Ghostflame Offline
Member

Posts: 152
Threads: 0
Joined: Mar 2011
Reputation: 0
#20
RE: Tetris: The dark descent (V1.1)

(04-26-2011, 01:22 PM)Scraper Wrote: +1 vote for Pac-Man. Tongue
+1 more, Pac-Man would be srs bsns.
04-26-2011, 10:13 PM
Find Reply




Users browsing this thread: 1 Guest(s)