Controls:
-Left - Left
-Right - Right
-Up - Rotate Tetrimino
-Down -Drop Faster
-S - Drop to Bottom
-Q - Hold
Requires Windows 7+ and IE 11+
Source can be downloaded Here
0.000.3
Changed: Suggested by iPhilip
-ColorHLSToRGB: This is used to get colors that work well against a black background
[Game] Tetris Windows 7+
[Game] Tetris Windows 7+
Last edited by maestrith on 31 May 2020, 06:57, edited 2 times in total.
John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
Re: Tetris Windows 7+
Prettiest and most functional version of tetris written in AHK I think there is! Ghost piece is awesome.
Re: Tetris Windows 7+
ThanksRUNIE wrote:Prettiest and most functional version of tetris written in AHK I think there is! Ghost piece is awesome.
John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
Re: Tetris Windows 7+
Awesome!
My score was like 4300 when my game ended and it simply began afresh... I couldn't see my final score.
My score was like 4300 when my game ended and it simply began afresh... I couldn't see my final score.
Re: Tetris Windows 7+
I'll add in a msgbox or something for a score.SKAN wrote:Awesome!
My score was like 4300 when my game ended and it simply began afresh... I couldn't see my final score.
John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
Re: Tetris Windows 7+
0.000.2
Added: Suggested by SKAN
-Final Score MsgBox
Added: Suggested by SKAN
-Final Score MsgBox
John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
Re: Tetris Windows 7+
This is really good. Yes the ghost piece is very nice (see where the piece is going to end up in advance), as is s to immediately place the piece.
I thought I might mention two nice old Windows games:
[This one is a relatively simple one, enemy planes, and your plane, fly around a 2D map, with blocks placed in many places. You can fire and they can fire.]
Alien Force : Robert Epps : Free Download & Streaming : Internet Archive
https://archive.org/details/win3_alienforce
[More complicated, but great game.]
Kye (video game) - Wikipedia
https://en.wikipedia.org/wiki/Kye_(video_game)
I thought I might mention two nice old Windows games:
[This one is a relatively simple one, enemy planes, and your plane, fly around a 2D map, with blocks placed in many places. You can fire and they can fire.]
Alien Force : Robert Epps : Free Download & Streaming : Internet Archive
https://archive.org/details/win3_alienforce
[More complicated, but great game.]
Kye (video game) - Wikipedia
https://en.wikipedia.org/wiki/Kye_(video_game)
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
- SpeedMaster
- Posts: 494
- Joined: 12 Nov 2016, 16:09
Re: Tetris Windows 7+
Beautiful.
Thanks for sharing !
Suggestion:
Please can you insert this tag [Game] as a prefix in your title ?
this will make the search easier
Thanks for sharing !
Suggestion:
Please can you insert this tag [Game] as a prefix in your title ?
this will make the search easier
Re: Tetris Windows 7+
Thanks and No ProblemSpeedMaster wrote:Beautiful.
Thanks for sharing !
Suggestion:
Please can you insert this tag [Game] as a prefix in your title ?
this will make the search easier
John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
Re: [Game] Tetris Windows 7+
12,900
Lines: 117
Lines: 117
Re: [Game] Tetris Windows 7+
kczx3 wrote:12,900
Lines: 117
John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
Re: [Game] Tetris Windows 7+
interesting. but, many of the pieces are near impossible to see. they are too dark against the black background.
Re: [Game] Tetris Windows 7+
Yea, I just did random colors...
John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
Re: [Game] Tetris Windows 7+
Hi maestrith,
You might want to experiment with this approach to getting colors that work against a black background. I have found it useful in my code:
Code: Select all
ColorARGB := "0xFF" ColorHLSToRGB(i > 240 ? mod(i, 240) : i, 120, 240) ; i is an integer, e.g. A_Index
; Reference: https://docs.microsoft.com/en-us/windows/win32/api/shlwapi/nf-shlwapi-colorhlstorgb - ColorHLSToRGB function
ColorHLSToRGB(Hue, Luminance, Saturation) {
BGR := DllCall("shlwapi.dll\ColorHLSToRGB", "UShort", Hue, "UShort", Luminance, "UShort", Saturation, "UInt")
Return Format("{:06X}", ((BGR & 0xFF) << 16) | (BGR & 0xFF00) | ((BGR >> 16) & 0xFF))
}
- iPhilip
Windows 10 Pro (64 bit) - AutoHotkey v2.0+ (Unicode 64-bit)
Re: [Game] Tetris Windows 7+
@iPhilip - what does your code have to do with Tetris? And, what does it do? The variables you define aren't used in the Tetris script.
Re: [Game] Tetris Windows 7+
Hi @joefiesta,
Thank you for your questions. I imagine you are confused by my message. Actually I was responding to a thread initiated by your comment
by offering a way to get colors that are more visible against a black background. I left it to @maestrith to decide whether to integrate the code into the Tetris script. Here is some code you can run to see the effect:
Code: Select all
#NoEnv
Gui, Color, Black
Gui, Add, Progress, x100 y100 w100 h100 cBlue BackgroundBlack vMyProgress, 100
Gui, Show, w300 h300, Colors
Loop
{
Random, Index, 0, 240
Color := ColorHLSToRGB(Index, 120, 240)
; Random, Color, 222222, 999999 ; Uncomment to see current color scheme in Tetris
GuiControl, % "+c" Color, MyProgress
Sleep 1000
}
; Reference: https://docs.microsoft.com/en-us/windows/win32/api/shlwapi/nf-shlwapi-colorhlstorgb - ColorHLSToRGB function
ColorHLSToRGB(Hue, Luminance, Saturation) {
BGR := DllCall("shlwapi.dll\ColorHLSToRGB", "UShort", Hue, "UShort", Luminance, "UShort", Saturation, "UInt")
Return Format("{:06X}", ((BGR & 0xFF) << 16) | (BGR & 0xFF00) | ((BGR >> 16) & 0xFF))
}
GuiClose:
GuiEscape:
ExitApp
Cheers,
- iPhilip
Windows 10 Pro (64 bit) - AutoHotkey v2.0+ (Unicode 64-bit)
Re: [Game] Tetris Windows 7+
@iPhilip - Thanks. I didn't mean to be disrespectful. I thought you meant I could drop your code into Tetris. I'm sure I can figure out what you're doing and can figure out revising tetris on my own even though it is very complicated, what with so many objects and such I know little about. But, considering this forum entry got almost no interest, I suspect nobody even uses the script. So, I doubt the author has much concern at this point. He was probably just working on his game writing skills.
Re: [Game] Tetris Windows 7+
I added it to the main script already.joefiesta wrote: ↑01 Jun 2020, 07:55@iPhilip - Thanks. I didn't mean to be disrespectful. I thought you meant I could drop your code into Tetris. I'm sure I can figure out what you're doing and can figure out revising tetris on my own even though it is very complicated, what with so many objects and such I know little about. But, considering this forum entry got almost no interest, I suspect nobody even uses the script. So, I doubt the author has much concern at this point. He was probably just working on his game writing skills.
John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
Re: [Game] Tetris Windows 7+
@maestrith - Thanks. A humungous improvement. Rather primary colors, but, they are perfect considering the simplicity of the game.
If I dare say, I would like to suggest some other changes. It's been decades since I played tetris on an ancient nintendo box. I don't remember the ghost square, but I like it, even though it makes playing easier.
1. The ghost piece would be nicer if it were more visible (solidly colored), say a somewhat dark shade of gray.
2. Levels would be nice. As one clears oh I don't know perhaps 25 lines, the speed of the pieces falling could increase a little, and the scoring could increase a little. I vaguing remember, too, that with Tetris as it got more difficult the shapes selected were less random--that is to say duplicate shapes tended to occur in sequence more often (which adds to the difficulty). But, I could be wrong about such a memory.
3. I would like the BLUE line surrounding the playing field to be brighter (more visible).
4. The help instructions on the side are rather difficult to read also. They could be a lighter shade of pink.
But, my compliments on a beautiful piece of coding. I guess it's time I learned about the advanced object (terminology??) techiniques you employ. But, what do you want from a retired mainframe programmer.
thanks again for the color fix.
If I dare say, I would like to suggest some other changes. It's been decades since I played tetris on an ancient nintendo box. I don't remember the ghost square, but I like it, even though it makes playing easier.
1. The ghost piece would be nicer if it were more visible (solidly colored), say a somewhat dark shade of gray.
2. Levels would be nice. As one clears oh I don't know perhaps 25 lines, the speed of the pieces falling could increase a little, and the scoring could increase a little. I vaguing remember, too, that with Tetris as it got more difficult the shapes selected were less random--that is to say duplicate shapes tended to occur in sequence more often (which adds to the difficulty). But, I could be wrong about such a memory.
3. I would like the BLUE line surrounding the playing field to be brighter (more visible).
4. The help instructions on the side are rather difficult to read also. They could be a lighter shade of pink.
But, my compliments on a beautiful piece of coding. I guess it's time I learned about the advanced object (terminology??) techiniques you employ. But, what do you want from a retired mainframe programmer.
thanks again for the color fix.
Re: [Game] Tetris Windows 7+
Hi @joefiesta,joefiesta wrote: ↑01 Jun 2020, 07:55@iPhilip - Thanks. I didn't mean to be disrespectful. I thought you meant I could drop your code into Tetris. I'm sure I can figure out what you're doing and can figure out revising tetris on my own even though it is very complicated, what with so many objects and such I know little about. But, considering this forum entry got almost no interest, I suspect nobody even uses the script. So, I doubt the author has much concern at this point. He was probably just working on his game writing skills.
Thank you for your note. I appreciate you reaching out to me. I totally empathize with you on the challenge of modifying other people's code. I mean, it's hard enough going back to my own code and figuring out why I did what I did - even with documentation and comments!
I am glad that @maestrith was able to integrate the function into the game. As you noted above, it's a significant improvement. When I played the new game, I noticed that the randomization of the colors was adding a degree of difficulty for me as my mind was trying to associate colors with shapes in order to anticipate the appropriate rotation or move. Who knew that color could add a degree of difficulty to a game!
Cheers,
- iPhilip
Windows 10 Pro (64 bit) - AutoHotkey v2.0+ (Unicode 64-bit)
Return to “Scripts and Functions (v1)”
Who is online
Users browsing this forum: No registered users and 66 guests