Page 4 of 5

Re: PureTris !

Posted: Sat Jul 01, 2023 1:26 pm
by Mindphazer
@Infratec
There is a small bug, i don't think it is the cause of your problem but....
Line 1286 should be :

Code: Select all

If SoundEnabled And IsSound(#SoundFall) And SoundIsOn(): PlaySound(#SoundFall) : EndIf
instead of

Code: Select all

If IsSound(#SoundFall) And SoundIsOn() : PlaySound(#SoundFall) : EndIf
This leads to a crash when you press space if there not sound card on the computer....

Re: PureTris !

Posted: Sat Jul 01, 2023 3:05 pm
by infratec
Yes, I start it from the IDE.

I was able to 'stop the prigramm execution and I was inside the EffacerLigne() procedure.
But I will do deeper inspections.

If it happens, the shadow is alreday at the wrong place.

Re: PureTris !

Posted: Sat Jul 01, 2023 3:18 pm
by infratec
The 'no response' happens if the other fault appars and I play further until a line disappears,
Then it hangs.

Re: PureTris !

Posted: Sat Jul 01, 2023 3:35 pm
by infratec
It happens only with the asm backend (PB 6.02 x86 on Win 10 x64)
The for loop in Procedure EffacerLigne(Ligne) looks then like this:
21
19
17
15
13
11
9
7
5
3
1

Code: Select all

For i = Ligne To 1 Step -1
    Debug i
    For j = 0 To #LargeurGrille - 1
      Grille(j, i) = Grille(j, i - 1)
    Next j
  Next i
I have no idea why.

Re: PureTris !

Posted: Sat Jul 01, 2023 3:43 pm
by Mindphazer
Wow
On my Mac M1, i use the C compiler.
And when i tested on Windows, I also used the C backend

I'm gonna try with ASM backend

Re: PureTris !

Posted: Sat Jul 01, 2023 3:52 pm
by infratec
Ok.

It's a PB bug. (In my opinion)
You specified the counter variables as .a and .b
Then it happens. If you use .i everything works fine.

If I use this code:

Code: Select all

Define i.a

For i = 10 To 0 Step -1
  Debug i
  For j = 0 To 10
  Next j
Next i
I get:
10
8
6
4
2
0
PB 6.02 x86 asm backend on Win 10 x64

Can someone confirm this?

Without the inner loop it's Ok.

Re: PureTris !

Posted: Sat Jul 01, 2023 4:32 pm
by Mindphazer
Well, i only use PB x64, and whatever compiler i use (ASM or C), your code gives me the right results :
10
9
8
7
6
5
4
3
2
1
0
But if I use PB x86, i get the same results as you, with ASM backend. With C backend, it's okay. Very strange...

Re: PureTris !

Posted: Sat Jul 01, 2023 5:01 pm
by Mindphazer
I have corrected the source to change the .a variables used in for .. step -1 / next loops to .i variables
The first post is updated.

Many many thanks to Infratec for pointing out the bug

Re: PureTris !

Posted: Thu Jul 06, 2023 4:37 am
by AZJIO
There was no desire to do it on SpiderBasic?

Re: PureTris !

Posted: Thu Jul 06, 2023 8:00 am
by Mindphazer
AZJIO wrote: Thu Jul 06, 2023 4:37 am There was no desire to do it on SpiderBasic?
Someone suggested it
I don't have a licence for SpiderBasic, so I can't even have a look for now

Re: PureTris !

Posted: Thu Jul 06, 2023 8:27 am
by AZJIO
You can use the Demo version and reduce the code to 800 lines. You have an old version of 900 lines. If you remove comments and empty lines, then 809 + 41 lines. Remove the statistics of the number of falling figures, since no one will look at it. For the phone, the game will become more relevant. If it works, then I think there will be a desire to buy.
See as an example:
viewtopic.php?t=80565
viewtopic.php?t=76759

Re: PureTris !

Posted: Fri Jul 07, 2023 10:07 am
by Mindphazer
Lol
You're probably right about the statistics :mrgreen:
I'll have a look at your suggestion when i'll find some time...

Re: PureTris !

Posted: Sat Jul 22, 2023 9:23 am
by Mindphazer
New version (1.1.0)
- No more statistics :mrgreen:
- Playing time is now stored in the hiscores
- you can hold a piece ("C" key)
- Shadows of the pieces is now an option

First post updated

Re: PureTris !

Posted: Sat Jul 22, 2023 2:06 pm
by AZJIO
Shadows -> ToolTip (help, clue?)

TextesENG:
Data.s "CheckBoxShadow", "Shadow"

TextesRUS (I had to remove other languages ​​besides English to enable Russian)

Code: Select all

Global UserIntLang, *Lang
If OpenLibrary(0, "kernel32.dll")
	*Lang = GetFunction(0, "GetUserDefaultUILanguage")
	If *Lang
		UserIntLang = CallFunctionFast(*Lang)
	EndIf
	CloseLibrary(0)
EndIf
If UserIntLang = 1049
; 	RUS
Else
; 	Eng
EndIf

Windows, Linux

Code: Select all

CompilerSelect #PB_Compiler_OS
	CompilerCase #PB_OS_Windows
		Global UserIntLang, *Lang
		If OpenLibrary(0, "kernel32.dll")
			*Lang = GetFunction(0, "GetUserDefaultUILanguage")
			If *Lang
				UserIntLang = CallFunctionFast(*Lang)
			EndIf
			CloseLibrary(0)
		EndIf
	CompilerCase #PB_OS_Linux
		Global UserIntLang$
		If ExamineEnvironmentVariables()
		    While NextEnvironmentVariable()
		    	If Left(EnvironmentVariableName(), 4) = "LANG"
; 		    		LANG=ru_RU.UTF-8
; 		    		LANGUAGE=ru
					UserIntLang$ = Left(EnvironmentVariableValue(), 2)
					Break
				EndIf
		    Wend
		EndIf
CompilerEndSelect

CompilerSelect #PB_Compiler_OS
	CompilerCase #PB_OS_Windows
		If UserIntLang = 1049
    CompilerCase #PB_OS_Linux
		If UserIntLang$ = "ru"
CompilerEndSelect

	Restore TextesRUS
EndIf

Re: PureTris !

Posted: Sat Jul 22, 2023 4:46 pm
by Mindphazer
Thanks AZJIO for your feedback
Ooops, i think i forgot some translations !!

I'll add a tooltip for the shadow checkbox

And i'll have a look to your code