Hello, I have another problem with the application speed. It redraws my board very slowly, I can see some circles redrawn when i make a move. I tried and optimized as best I could, but I don't know witch part is the slowest to fix it. The game is uploaded on Livecodeshare=runrev=com and it is caled Othello. I can't work on the computer logic because it is already too slow to use. The exe file is slow too. Can anybody confirm that is slow on their PC ?
Thank you.
Slow display of game board in Othello
Moderators: FourthWorld, heatherlaine, Klaus, robinmiller
Slow display of game board in Othello
Passionate developer
Re: Slow display of game board in Othello
I haven't tried the program, but am curious if you used 'lock screen' or not in the code. If not, it can dramatically improve the speed at which boards get redrawn, since it is not allowing the screen to be updated until the 'unlock screen' shows up.
Re: Slow display of game board in Othello
Hi Kry,
I added a lock screen and it looked way better!
After a quick look, in the card script in handler "play_g" just add these marked lines:
Please try and tell us if that works for you.
Best
Klaus
I added a lock screen and it looked way better!
After a quick look, in the card script in handler "play_g" just add these marked lines:
Code: Select all
command play_g x,y //the core of the game
local lturn
//we need current turn to test for valid moves
if gTurn is "h" then put 1 into lturn else put 2 into lturn
## This one:
lock screen
//if it empty space then test it for valid move
if a[x][y] = 0 and ValidMove (x,y,lturn ) = 1 then
MutaPiesa x,y,lturn //move if it is a valid move only
ChangeTurn
afis //redraw board
## and this one:
unlock screen
else
answer "Wrong move !"
end if
end play_g
Best
Klaus
Re: Slow display of game board in Othello
Thank you !
It is very fast now in displaying the board, I should remember this trick.
I am working on making this app more interesting by making the PC to think and move against humans not so easy that I believed ..
It is very fast now in displaying the board, I should remember this trick.
I am working on making this app more interesting by making the PC to think and move against humans not so easy that I believed ..
Passionate developer