Othello game
Hi i'm deeeeeesperate for some help.
I'm trying to make a othello game but i can't get the damn grid to show. The
grid.UpdateBoard(Board.BoardState);
is meant to place the grid onto the Othello Game window as shown in the picture. Does someone know what might be wrong and able to help? https://github.com/aljomatrix/Assignment2Repository20 Replies
Any errors at the top of the window when you proceed with the code?
No no errors at all
Also note with the breakpoint being on the operation,
UpdateBoard
is not called yetI have been trying to troubleshoot for a couple of hours now so the code has been changed
I can push the changes to github
The problem mainly relies in GameGrid as it's not displaying the pieces correctly. However it is doing the game correct in the background as far as i can tell.
I pushed the changes
This is so complicated to me π i have no idea how to fix it
It's actually going through the loop and playing the game (because both player1 and player2 currently plays as AI) in the background.
But nothing changes visually. Not even the pieces show up.
This is the actual part that updates the pieces on the board
And once it gets to row 4 column 5 it actually doers fill an ellipse with the brush black
But nothing is showing ?
I pushed my changes but i'm simply gonna wait to see if someone is able to help me. Lowkey desperate for help..
Okay, so I know almost nothing about Desktop programming, but I gave it a shot and pulled your repo
Your issue isn't a brush or similar
Your issue is that your game loop is entirely blocking and doesn't allow the main thread to repaint
I tried to exchanged some parts for an async-await waiting for a player turn and now the rendering works as you described
@Sossenbinder really?!
I'd love to see what you did for it to work
i've been plagued with it for the past 3 days π
Sure, one sec
https://github.com/aljomatrix/Assignment2Repository/commit/3b07dc93b5cec392ce3faafcd9ea4aceaafc2555
Forked your repo
Note that I'm not a desktop programmer though, so I'd probably check with the #gui peeps what the preferred way of doing this would be
Just wanted to verify the problem is you keeping the main loop hostage haha
I'm a bit of a beginner to github. How would i test the code?
Or merge it to main perhaps
Or would i need a ned repo for that?
Ah, I could probably also create a pull request to yours, but I'm about to head to bed so I won't manage to do so anymore today
You can probably apply the changes by hand just to explore the result, shouldn't be too bad
If you set the layout to "Split" it's a bit clearer to see both states
Should be quick to apply that way
aaah i can see them!!!!!!!!! <3
i fucking love you
Now i just have to clean up so that the game works properly
you are my literal saviour thank you so much
Gl
Make sure to read up on WPF threading model and why blocking the main thread causes that issue
will do!
!solved