Page 2 of 5
Re: PureTris !
Posted: Fri Apr 21, 2023 6:32 pm
by Mindphazer
By the way, if someone has a way to force the redraw of the piece every line while it drops (by pressing Space bar), i'll be grateful !
It's located in the loop
The MoveDown() procedure moves the piece one line below, but the CanvasGadget is not refreshed, so the piece is only redrawn at the bottom of the game area...
I've tried to insert a
inside the loop, but it has no effect.
On MacOS, inserting a
does it, but doesn't on Windows....
Thanks
Re: PureTris !
Posted: Fri Apr 21, 2023 10:47 pm
by Janni
Great work Mindphazer. I will study this to learn.
Plays great on Linux Mint 20.3
Re: PureTris !
Posted: Fri Apr 21, 2023 11:43 pm
by infratec
You can try this:
Code: Select all
Case #PB_Shortcut_Space
RemoveWindowTimer(#MainWindow, #Timer)
AddWindowTimer(#MainWindow, #Timer, 10)
And
Code: Select all
Case #PB_Event_Timer
If EventTimer() = #Timer
If MoveDown() = 0
RemoveWindowTimer(#MainWindow, #Timer)
AddWindowTimer(#MainWindow, #Timer, tempo)
EndIf
EndIf
Re: PureTris !
Posted: Fri Apr 21, 2023 11:47 pm
by Mindphazer
Janni wrote: Fri Apr 21, 2023 10:47 pm
Great work Mindphazer. I will study this to learn.
Plays great on Linux Mint 20.3
Thanks Janni
Glad you like it !
Re: PureTris !
Posted: Fri Apr 21, 2023 11:48 pm
by Mindphazer
infratec wrote: Fri Apr 21, 2023 11:43 pm
You can try this:
Code: Select all
Case #PB_Shortcut_Space
RemoveWindowTimer(#MainWindow, #Timer)
AddWindowTimer(#MainWindow, #Timer, 10)
And
Code: Select all
Case #PB_Event_Timer
If EventTimer() = #Timer
If MoveDown() = 0
RemoveWindowTimer(#MainWindow, #Timer)
AddWindowTimer(#MainWindow, #Timer, tempo)
EndIf
EndIf
That's very smart Infratec !
Thanks a lot the the tip
Re: PureTris !
Posted: Sat Apr 22, 2023 6:08 am
by Bisonte
Very nice

Re: PureTris !
Posted: Sat Apr 22, 2023 8:53 am
by Mindphazer
Thank you Bisonte
I have updated the code (version 1.0.2) with a few enhancements (thanks Fred & Infratec)
The game can be paused with "P" key
See first post
Re: PureTris !
Posted: Wed May 03, 2023 11:14 am
by Mindphazer
Hi
I've corrected a few annoying bugs (surprisingly, they were present only on Windows, not on MacOS, that's why I did not noticed them)
I've also made a few improvements (statistics, shadow of the piece to see where it will be positioned when it falls)
I'm still hunting for bugs, but I hope they are very few left
First post updated
Beware, the form has been modified too, so don't forget to copy the form and the source (I'm too lazy to insert the form inside the source !)
Re: PureTris !
Posted: Sun Jun 25, 2023 7:33 pm
by miskox
Very nice! But I think there are some bugs: if a piece (at least some of them) is all the way to the left or to the right rotating it does not work or stops working (if I rememebr correctly in original it works).
Saso
Re: PureTris !
Posted: Sun Jun 25, 2023 8:11 pm
by jassing
miskox wrote: Sun Jun 25, 2023 7:33 pm
Very nice! But I think there are some bugs: if a piece (at least some of them) is all the way to the left or to the right rotating it does not work or stops working (if I rememebr correctly in original it works).
Saso
They rotate around the center, so at the edge it's blocked... Pretty sure this is normal.
Re: PureTris !
Posted: Sun Jun 25, 2023 10:12 pm
by Mindphazer
miskox wrote: Sun Jun 25, 2023 7:33 pm
Very nice! But I think there are some bugs: if a piece (at least some of them) is all the way to the left or to the right rotating it does not work or stops working (if I rememebr correctly in original it works).
Saso
Yeah you're right. I have already corrected this behaviour, plus some few things (mostly cosmetics) but i've been busy these days so i didn't have time to post the new version yet
I'll try to do it in the next days.
Re: PureTris !
Posted: Mon Jun 26, 2023 5:38 pm
by miskox
Thanks. If you are updating it...maybe add a keyboard shortcut for 'start new game' and 'quit/exit'?
I couldn't find an option to store a piece. If my memory serves me right it was possible to 'store' a piece and use it later for example. (or maybe I just can't find a key).
Otherwise thank you again - I played it for a long time and I really enjoyed it.
Saso
Re: PureTris !
Posted: Mon Jun 26, 2023 7:27 pm
by AZJIO
Great.
Is it possible to add settings:
1. Figures should not be repeated.
2. The total number of figures is the same on average. If some figure often falls out, then in the next step, if it falls out again, then another random figure is requested. That is, so that there is no alternation of two figures more often than others. One figure came across in a row 3-5 times.
3. Add a level of difficulty. At an easy level, you can change the expected figure 1 time. The next figure is indicated at the top right, and it could be changed using the F2 key, but no more than 1 time per turn.
4. In a difficult level, increase the speed of the fall of the figure, but not to such an extent that it is impossible to play.
5. Game mode without time. A figure has appeared and you are thinking how to put it. It only drops when you press the down arrow. In this mode, you can find out if the game creates situations where you cannot win because the pieces do not allow you to do so.
6. When saving, add UTF+BOM. Or better to encrypt records.
7. Add language support
I scored 19794 points, while the speed was so high that it was impossible to figure out where to put the piece, you just move it into free space so as not to line up in a pillar.
Re: PureTris !
Posted: Mon Jun 26, 2023 10:59 pm
by Mindphazer
miskox wrote: Mon Jun 26, 2023 5:38 pm
Thanks. If you are updating it...maybe add a keyboard shortcut for 'start new game' and 'quit/exit'?
I couldn't find an option to store a piece. If my memory serves me right it was possible to 'store' a piece and use it later for example. (or maybe I just can't find a key).
Otherwise thank you again - I played it for a long time and I really enjoyed it.
Saso
Keyboard shortcuts to start and quit a game are already implemented in the next version.
There is no option to store a piece as it was not on my todo list

But i may change my mind some day...
Thanks a lot, i'm glad you enjoyed it !
Re: PureTris !
Posted: Mon Jun 26, 2023 11:14 pm
by Mindphazer
AZJIO wrote: Mon Jun 26, 2023 7:27 pm
Great.
Is it possible to add settings:
1. Figures should not be repeated.
2. The total number of figures is the same on average. If some figure often falls out, then in the next step, if it falls out again, then another random figure is requested. That is, so that there is no alternation of two figures more often than others. One figure came across in a row 3-5 times.
3. Add a level of difficulty. At an easy level, you can change the expected figure 1 time. The next figure is indicated at the top right, and it could be changed using the F2 key, but no more than 1 time per turn.
4. In a difficult level, increase the speed of the fall of the figure, but not to such an extent that it is impossible to play.
5. Game mode without time. A figure has appeared and you are thinking how to put it. It only drops when you press the down arrow. In this mode, you can find out if the game creates situations where you cannot win because the pieces do not allow you to do so.
6. When saving, add UTF+BOM. Or better to encrypt records.
7. Add language support
I scored 19794 points, while the speed was so high that it was impossible to figure out where to put the piece, you just move it into free space so as not to line up in a pillar.
Thanks AZJIO for your feedback.
I'll have a look at the random distribution of the pieces. For now it's just a simple and basic random function. I have to think how to do this
Adding the possibility to change the next figure is a good idea.
You're right : The speed is indeed too high in the high levels, and the game is unplayable ! I have changed the way the speed increases in the upcoming version.
Language support is now half done in the next version : all the strings are stored in a Datasection, making it easier to adapt to your language