PureTris !

Advanced game related topics
User avatar
Mindphazer
Enthusiast
Enthusiast
Posts: 456
Joined: Mon Sep 10, 2012 10:41 am
Location: Savoie

Re: PureTris !

Post 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....
MacBook Pro 16" M4 Pro - 24 Gb - MacOS 15.4.1 - Iphone 15 Pro Max - iPad at home
...and unfortunately... Windows at work...
infratec
Always Here
Always Here
Posts: 7577
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: PureTris !

Post 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.
infratec
Always Here
Always Here
Posts: 7577
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: PureTris !

Post by infratec »

The 'no response' happens if the other fault appars and I play further until a line disappears,
Then it hangs.
infratec
Always Here
Always Here
Posts: 7577
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: PureTris !

Post 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.
User avatar
Mindphazer
Enthusiast
Enthusiast
Posts: 456
Joined: Mon Sep 10, 2012 10:41 am
Location: Savoie

Re: PureTris !

Post 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
MacBook Pro 16" M4 Pro - 24 Gb - MacOS 15.4.1 - Iphone 15 Pro Max - iPad at home
...and unfortunately... Windows at work...
infratec
Always Here
Always Here
Posts: 7577
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: PureTris !

Post 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.
User avatar
Mindphazer
Enthusiast
Enthusiast
Posts: 456
Joined: Mon Sep 10, 2012 10:41 am
Location: Savoie

Re: PureTris !

Post 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...
MacBook Pro 16" M4 Pro - 24 Gb - MacOS 15.4.1 - Iphone 15 Pro Max - iPad at home
...and unfortunately... Windows at work...
User avatar
Mindphazer
Enthusiast
Enthusiast
Posts: 456
Joined: Mon Sep 10, 2012 10:41 am
Location: Savoie

Re: PureTris !

Post 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
MacBook Pro 16" M4 Pro - 24 Gb - MacOS 15.4.1 - Iphone 15 Pro Max - iPad at home
...and unfortunately... Windows at work...
AZJIO
Addict
Addict
Posts: 2141
Joined: Sun May 14, 2017 1:48 am

Re: PureTris !

Post by AZJIO »

There was no desire to do it on SpiderBasic?
User avatar
Mindphazer
Enthusiast
Enthusiast
Posts: 456
Joined: Mon Sep 10, 2012 10:41 am
Location: Savoie

Re: PureTris !

Post 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
MacBook Pro 16" M4 Pro - 24 Gb - MacOS 15.4.1 - Iphone 15 Pro Max - iPad at home
...and unfortunately... Windows at work...
AZJIO
Addict
Addict
Posts: 2141
Joined: Sun May 14, 2017 1:48 am

Re: PureTris !

Post 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
User avatar
Mindphazer
Enthusiast
Enthusiast
Posts: 456
Joined: Mon Sep 10, 2012 10:41 am
Location: Savoie

Re: PureTris !

Post 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...
MacBook Pro 16" M4 Pro - 24 Gb - MacOS 15.4.1 - Iphone 15 Pro Max - iPad at home
...and unfortunately... Windows at work...
User avatar
Mindphazer
Enthusiast
Enthusiast
Posts: 456
Joined: Mon Sep 10, 2012 10:41 am
Location: Savoie

Re: PureTris !

Post 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
MacBook Pro 16" M4 Pro - 24 Gb - MacOS 15.4.1 - Iphone 15 Pro Max - iPad at home
...and unfortunately... Windows at work...
AZJIO
Addict
Addict
Posts: 2141
Joined: Sun May 14, 2017 1:48 am

Re: PureTris !

Post 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
User avatar
Mindphazer
Enthusiast
Enthusiast
Posts: 456
Joined: Mon Sep 10, 2012 10:41 am
Location: Savoie

Re: PureTris !

Post 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
MacBook Pro 16" M4 Pro - 24 Gb - MacOS 15.4.1 - Iphone 15 Pro Max - iPad at home
...and unfortunately... Windows at work...
Post Reply