tetr.js development thread

Started by simonlc, March 17, 2013, 10:49:15 AM

Previous topic - Next topic

clincher

#15
Up arrow seems to always be mapped to rotate, even if I changed the controls. In my case, I set the up arrow as soft drop, so it rotates the piece once and soft drops while I keep it pressed.

EDIT: I also think a reasonable request would be to lower the default DAS. I think it's 12 frames right now, maybe we could it get it as low as 8 as default?

I'm assuming 8 is not too fast. I never really used insanely short DAS
It's all about the love

simonlc

Quote from: clincher
Up arrow seems to always be mapped to rotate, even if I changed the controls. In my case, I set the up arrow as soft drop, so it rotates the piece once and soft drops while I keep it pressed.

EDIT: I also think a reasonable request would be to lower the default DAS. I think it's 12 frames right now, maybe we could it get it as low as 8 as default?

I'm assuming 8 is not too fast. I never really used insanely short DAS
I just fixed the up arrow thing. I'm working on DAS configuration now, might have something playable tomorrow evening.

Extruderx

#17
Nice game, good to see that HD actively helps in developing! I agree about setting default DAS at 8 (otherwise it's too slow to beat even TF 40L time).

Kepra

Simply a great start for a Tetris clone! I would like to see if there more improvements for the game ^^

Quote from: simonlc
Thanks, I was able to reproduce it once, but not again. I made a small edit but I have no idea if it's fixed.

anyways, I redid the bug, and it happened again, as you've already made the small edit.

simonlc

#19
Quote from: Extruderx
Nice game, good to see that HD actively helps in developing! I agree about setting default DAS at 8 (otherwise it's too slow to beat even TF 40L time).
I'll see about changing the default, atm it's 14, 8 sounds reasonable. The setting will be customizable, but I want to have a good default for maybe a first time player. Advanced players will likely want to make it lower anyway.

Quote from: Kepra
Simply a great start for a Tetris clone! I would like to see if there more improvements for the game ^^
anyways, I redid the bug, and it happened again, as you've already made the small edit.

Yeah I recently got it again too. I'm looking into it now.

EDIT: I just found out what is causing the line clear bug. It's due to javascript's very stupid sort method.

If you sort [21, 19, 20] you will get [19, 20, 21] as expected. If you sort [10, 9, 11] you get [10, 11, 9]. Even though 10 is bigger than 9, it only looks at the first digit first, so 1 is smaller than 9 and that's why 9 is at the end. So this is why the line clear code only messes up in that spot. I should have this fixed soon.

EDIT 2: Line clear bug is fixed.

EDIT 3: Fixed the rotate bug. All known bugs are fixed now.

Barneey

Yessss awesome. Will give feedback when i have time to play!

NoManual

#21
Looks awsome!

One thing that is not working for me tho is the Up key for CW rotate, is this intentional? Did you change it? Or is it just a bug?

Just read through the pages and discovered that I can acutally change the keys myself lol  Nice implement ^^
40L = 28.71
My Blog

simonlc

#22
Quote from: Barneey
Yessss awesome. Will give feedback when i have time to play!
Can't want to hear it.



Update on the game: So this weekend I had some computer problems and reformatted, but I'm back up to speed now. In the latest version online I've improved the handling of left and right movement. It matches NullpoMino in this regard now. Before you pressed left and then right, if both keys were still down the piece wouldn't behave well.

I've also fully implemented configurable ARR and DAS, you will be able to use any value you want for either. I'm still reworking the settings panel so I haven't published this version yet. Another thing I've added is the big number on the left that shows how many lines you have left. It will have the same colors as the progress bar.

There's still a lot of work to be done before I start implementing features like the trainer, and others, but if anyone has any ideas I'd love to hear them now so I can start planning them.

UJS3

This is so great, good job finding that sort()... idiosyncrasy. Sounds like the kind of thing that would take me a long time to discover.

As for feature requests, a leaderboard would be cool once DAS can be customized.

MarioThePhenom

create your own tetris game?
this is something my friends asked me about, they wanted to know if there was anyplace you could set the difficulty curve and when certain things happen(they wanted to challenge me)
so an example would be after x score, the gravity is increased to(insert value of gravity where -1 is instant)
sounds kinda odd but that would be cool imo
and as UJS said, leaderbords would be cool too, but probably way easier than the create your own tetris game

Quote from: PandaLol no, that's ludacris. I have a sentence generator, Blink....

FelipeMayrink

Quote from: simonlc
Current mechanics and features
  • Tetris Guideline compliant
  • Configurable controls
  • Game statistics like PPM, Time, etc.
  • Configurable gravity[/b][/u]
  • 60 FPS
  • Fast code and draw method

Wait, I just noticed this. Is there configurable gravity? Where?

StS

Just tried it out, but the playing field feels a bit uncomfortable, because it only just fits onto my screen. I've got a strange, 1366x786 resolution, which might be causing this, but do you reckon it would be possible to make the field size customisable, or at least scale it to the height of the screen/window?
Sandal that Stinks

Current 40L (Nullpo): 35.32s

simonlc

#27
Sorry for the long post, just wanted to reply to everyone.

Quote from: UJS3
This is so great, good job finding that sort()... idiosyncrasy. Sounds like the kind of thing that would take me a long time to discover.

As for feature requests, a leaderboard would be cool once DAS can be customized.
Thanks. It's actually funny, I read through the code word by word at least 3 times before I started researching something unrelated. I stumbled upon a comment saying how bad javascript's sort method was and that instantly clicked in my head what the problem was.

If you mean local leaderboards, that's been the plan, and everything is setup to do that. I just want a good way to display it, which is what is taking time. Online however I don't see happening for a long time, but I really do want to eventually have it online.

Quote from: MarioThePhenom
create your own tetris game?
this is something my friends asked me about, they wanted to know if there was anyplace you could set the difficulty curve and when certain things happen(they wanted to challenge me)
so an example would be after x score, the gravity is increased to(insert value of gravity where -1 is instant)
sounds kinda odd but that would be cool imo
and as UJS said, leaderbords would be cool too, but probably way easier than the create your own tetris game
As great as that sounds, it's unlikely I will ever do that, I don't have the skills to do that, and if I did I'd probably want to be payed to do it.

Quote from: FelipeMayrink
Wait, I just noticed this. Is there configurable gravity? Where?
Yes, sorry, this is implemented, but there's no control for it yet. I've been working on a new settings menu all day, it's taking longer than I thought since I have to add browser support for certain html5 features.

Quote from: StS
Just tried it out, but the playing field feels a bit uncomfortable, because it only just fits onto my screen. I've got a strange, 1366x786 resolution, which might be causing this, but do you reckon it would be possible to make the field size customisable, or at least scale it to the height of the screen/window?
Yes, I've been playing around with a nice way to do this (I have a working prototype Snake game), but I've not yet chosen exactly how I want to do it. Would you prefer to be able to set the size, or have it just make the field as big as will fit?



I have an exam tomorrow, and then I'm heading down to see some family. Though it's likely that I'll be working on the game more there, it'll probably be more conceptual things. I need to sketch it out so it's easier for me to make it. I'm really not happy with any UI things I've been making, and it just needs to be all laid out. I have a huge list of TODO items that probably wont be marked off for months to come, but I will eventually and I want the UI to be able to accept those things. It's very likely that the next update everyone sees will have a ton of new things, but none of it will work.

FelipeMayrink

How about some other block skins to choose from? That would be a nice feature...

Also, not really a big fan of the white background. Maybe I'm just too used to Nullpomino, but still...

UJS3

Quote from: FelipeMayrink
How about some other block skins to choose from? That would be a nice feature...

Also, not really a big fan of the white background. Maybe I'm just too used to Nullpomino, but still...

I agree on both counts  

I don't know how block skins are implemented in HTML5, but if it's like nullpo (simple image files) then perhaps we can help by submitting skins. I prefer bare bones, solid color.