Author Topic: Grammer Tetris  (Read 10616 times)

0 Members and 1 Guest are viewing this topic.

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Grammer Tetris
« on: October 23, 2011, 02:41:05 pm »
Hi, I have started some days ago programming Tetris in grammer! Some of you may have noticed me talking about it on chat. Well, for those who don't: I have already pretty much done, I think I'll have the beta up soon!
What I have already done:
 - all blocks, you can rotate them
 - checks that you can't go to far left/right
 - checks that you cant go through other blocks
 - checks whether the block hits the bottom or a other block
 - the possibility for fast down (pressing down-button)
 - automatic go down

Things I have to add for the beta:
 - check whether a line is complete
 - make that line go away
 - check whether you lost
 - put in that it is random what figure appears (easy, just one line of code! :D)
 - take out the possibility to change the figure by pressing 2ND :D :D :D

Things I then STILL have to do for the full version:
 - score
 - make it go down faster after some time
 - menu
 - high-score list
 - display the next block
( - some other cool features!)

Sorry, I don't have any screenies yet. I don't know if I will even make any before the betta. Please tell what you think about it! :)
« Last Edit: October 23, 2011, 02:50:59 pm by Sorunome »

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Grammer Tetris
« Reply #1 on: October 23, 2011, 03:24:06 pm »
good luck! XD
Sig wipe!

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer Tetris
« Reply #2 on: October 23, 2011, 03:47:40 pm »
So you have a way to make sure the block doesn't go through another block? Then you can probably use a series of pxl-Test( in a for loop to test if a line is complete. If the shape was 2 blocks tall, you only need to test those two rows.

Use the same idea for checking if you lose :)

As for shifting blocks down, I am not sure how that will work :/ I know I could whip up some code in Grammer, but it would be a little complicated and use several buffers.

EDIT: Okay, here is the complicated piece code I was talking about XD It took some thought, but I figured it out :)
Code: [Select]
Send(768,"VGBuf→K
37696→J
Lbl "SD→I

<<code>>

.SD
Disp K
ClrDraw
Line(X,Y,H-4,W,1
Fill(10,J
Fill(13,J
Tangent(4,1
Fill(13,J
Disp J
Line(X,Y,H,W,0
Fill(9,K
End
The shifting code is at .SD
The inputs to that subroutine are:

X and Y are the upper left coordinates of the place to begin shifting at
H and W are the height and width of the region to shift down
K points to a 768-byte buffer
J points to the main buffer (usually the graph buffer)
I hope that helps!

Offline Stefan Bauwens

  • Creator of Myst 89 - סטיבן
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1799
  • Rating: +162/-24
  • 68k programmer
    • View Profile
    • Portfolio
Re: Grammer Tetris
« Reply #3 on: October 24, 2011, 05:12:46 am »
Good luck with this. :D


Very proud Ticalc.org POTY winner (2011 68k) with Myst 89!
Very proud TI-Planet.org DBZ winner(2013)

Interview with me

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Grammer Tetris
« Reply #4 on: October 24, 2011, 10:42:57 am »
So you have a way to make sure the block doesn't go through another block? Then you can probably use a series of pxl-Test( in a for loop to test if a line is complete. If the shape was 2 blocks tall, you only need to test those two rows.

Use the same idea for checking if you lose :)

As for shifting blocks down, I am not sure how that will work Undecided I know I could whip up some code in Grammer, but it would be a little complicated and use several buffers.
I was already going to make the check weather a line is complete with pixel checks. :P
And If you lose I wanted to check the y-variable, if it is to small you lose.
And to the shifting: I draw all figures twice: once it leaves the loop where it waits for a keypress/shifting down it draws the figure in white pixels, I change the position of the figure and then I draw it in black ones! xD
« Last Edit: October 24, 2011, 10:56:38 am by Sorunome »

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer Tetris
« Reply #5 on: October 24, 2011, 05:09:03 pm »
Oh, I meant shifting the whole block so when a row gets deleted, the ones above can be shifted down :)

Offline Anima

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 133
  • Rating: +4/-0
    • View Profile
Re: Grammer Tetris
« Reply #6 on: October 24, 2011, 06:16:46 pm »
Good luck! :)


Sorry for my bad English. I'm German.

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Grammer Tetris
« Reply #7 on: October 25, 2011, 06:54:47 am »
Oh, I meant shifting the whole block so when a row gets deleted, the ones above can be shifted down :)
I alswell wanted to do that with ixel test. :)

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Grammer Tetris
« Reply #8 on: October 26, 2011, 09:01:04 am »
I don't know why, but it throughs an error when it shall shift everything down if a line is complete.....
Well, this is the responsible code:
Code: [Select]
:For(O,1,26
:0→H
:For(A,1,10
:H +pxl-Test(65535+O*4,1+4*A)
:→H
:End
:If H=10
:Then
:O-1→O
:For(P,0,O)
:For(Q,1,10)
:O-P→R
:pxl-Test(4*R,4*Q)→K
:If K=1
:Then
:Line(4*Q,4*R,4,4,0
:Line(4*Q,4*1+R,4,4,1
:End
:If K=0
:Line(4*Q,4*1+R,4,4,0
:DispGraph
:End
:End
:
:End
Please help me! D:

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer Tetris
« Reply #9 on: October 26, 2011, 09:15:05 am »
Okay, so you asked on IRC about how to use the code I gave, but I will post here anyway...
With mine, you will need 2 buffers J and K. Just use 37696→J for the graph buffer and create a tempprog of 768 bytes for the other. So somewhere at the beginning of your code:
Code: [Select]
37696→J
Send(768,"VTeMP→K
...And yes, that is a lowercase e >.>

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Grammer Tetris
« Reply #10 on: October 26, 2011, 10:20:04 am »
Ok, cool, thanks. I think I'll have beta up soon!
All I need to do now is a check whether you die! :)

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Grammer Tetris
« Reply #11 on: October 26, 2011, 11:41:55 am »
Ok, I have finally finished the beta of this! (Some of you may think this isn't allowed due to double posting rules, but I checked them and you may double post in the next hour when you have big project updates)
Well, the controls are simple, up is rotate block, and the other arrow keys are quite obvious! :P
Clear is exit.
If you lose the game just simply exits.
Be sure to check out the screenshot!

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Grammer Tetris
« Reply #12 on: October 26, 2011, 11:43:59 am »
Just tried. Nice!
It gives me syntax error if I die :P
Sig wipe!

Offline Stefan Bauwens

  • Creator of Myst 89 - סטיבן
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1799
  • Rating: +162/-24
  • 68k programmer
    • View Profile
    • Portfolio
Re: Grammer Tetris
« Reply #13 on: October 26, 2011, 11:55:20 am »
Looks very nice! :D


Very proud Ticalc.org POTY winner (2011 68k) with Myst 89!
Very proud TI-Planet.org DBZ winner(2013)

Interview with me

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Grammer Tetris
« Reply #14 on: October 26, 2011, 11:56:43 am »
Thanks both of you!
Yeong: I don't know why it throughs a syntax error, to me it doesn't... :S

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!