. /../Checkers/ 12
written by Jam on May 09, 2010 04:34
I made a simple checkers game.

So far, it's just checkers. No networking, AI or savegames. It doesn't even tell you when you've won. Though I'm planning to add in all those features.
This is the first (complex) program I've made, so if it probably isn't written very efficiently. I tried to separate the graphics part from the engine part. Hopefully that will make it easier to write other, similar board games (at least, that what I told myself when I decided to separate them). If anyone wants to give some advice on how I could make the program better, that would be great.

Give your feedback. I'll listen.

Enjoy.

cd/zips/Jam/checkers (17 Kb)

(NOTE: Version 0.2 has been released. Look near the end of the thread for a link.)
└> last changed by Jam on May 15, 2010 at 01:04
kyaaaaaaaaaaaaa!
written by Albeyamakiir on May 09, 2010 05:28
There's a bug. When you can jump over two pieces in the same turn (and I believe you have to, iirc), if you click on the piece you're moving after you've only jumped once, it deselects it and makes it the opponent's turn.
written by Jam on May 09, 2010 05:50
Thanks, I will fix that.

That was the one part of the selecting mechanism that I wasn't sure about.
I had written it so that if you could jump again the piece would be preselected. If you clicked any piece that wasn't a valid move, it would cancel the jump and switch to the opponent's turn. Moving a piece to the same square as it started at isn't a valid move, so the program cancels the jump.

I also made it so that you aren't forced to jump if you can. I eventually will add an option to change to the forced jump version, but for now you can make whatever move you want.
written by E_net4 on May 10, 2010 18:23
I don't really know what you did with the display interface in this program, but Windows 7 changes to Basic color scheme when I run this. Also, is the cursor supposed to be invisible right now?
The mouse click is also a bit tricky right now, forcing you to hold the mouse button for a bit until the piece is selected. I hope to see you find a way around that.

Nevertheless, I like it! :>
written by Jam on May 11, 2010 00:57
E_net4 said:
I don't really know what you did with the display interface in this program, but Windows 7 changes to Basic color scheme when I run this.
I don't think I used the display interface any different than it is used in the examples. I don't have Windows 7, or even frequent access to a Windows computer, so I didn't know it had that problem, and can't test if any future versions have the same problem or not.
That's odd... and other Lino programs don't do that? Could it be because I compiled it using WINE? Maybe recompiling it will help.

E_net4 said:
Also, is the cursor supposed to be invisible right now?
I didn't add a cursor yet... That's another thing I plan to add.

E_net4 said:
The mouse click is also a bit tricky right now, forcing you to hold the mouse button for a bit until the piece is selected.
It selects when the mouse button is released (I probably should change that). Maybe that's why clicking doesn't seem to work right.

E_net4 said:
Nevertheless, I like it! :>
Thank you!!! I'll keep working on the next version. Hopefully it will be done in a week or two. (No promises though...)
written by Cryoburner on May 11, 2010 00:58
I'm guessing the lack of cursor may be intentional, since you can still determine your position by the highlighted square. I guess it could work either way, though having a cursor might be a little more user-friendly.

I noticed the mouse click issue as well though. The problem sometimes occurs if you click quickly enough, and might be due to the way the program sleeps in 1 ms intervals until a certain amount of time has passed each loop. If you manage to click and release in less than 1/24th of a second, it's possible for the click to not register. A simple fix for this is just to move the call to "check button presses" into the "end synchronization loop", so that it's called once each millisecond.

That might actually be something worth looking into for the RTM though, as well. Ideally, the RTM should report all clicks that occur between one frame and the next as being active button presses. Otherwise, if you press and release a mouse button between two checks, it can get missed.

As for Windows 7 leaving aeroglass, I'm fairly sure that was reported some time back with Vista, and I believe it was subsequently fixed. Jam seems to be using an older version of the compiler though, indicated by the square program icon. I'd recommend recompiling it with the 1.2 compiler, as that likely fixes it, without having to modify the program's code. I'm on XP, so I didn't notice either way. ; )
written by E_net4 on May 11, 2010 13:45
That's probably it. But I don't feel like compiling it here, as I wish to stick to Lino 2. It shouldn't be too hard to convert this one, especially when no module extensions were used.
written by Ajax on May 13, 2010 18:13
I considered making a checkers game at one point, but never did. I started on the visual part first and that's about all I got.

I didn't notice the problem with clicking the pieces or anything, but then again it may have been fixed.

For user-friendlyness, you'll probably want to add a mouse pointer at some point. I found it a bit annoying not to have one, but was able to manage anyway.

Keep up the good work!
written by Jam on May 15, 2010 00:40
Thanks for your feedback Albeyamakiir, Cryoburner, E_net4, and Ajax!!

I recompiled the program with Lino 1.2, moved the "check button presses" call, added a mouse pointer, and added a menu. Hopefully that will fix most of the problems.

I think there's been enough changes that it's time for me to upload version 0.2.

cd/zips/Jam/checkers02 (28 Kb)

I'll probably start working on networking next. If I don't run into any major problems, I'll probably be done in a week or two.
└> last changed by Jam on May 15, 2010 at 02:27
written by Ajax on May 15, 2010 05:12
Looks good! Although the program keeps crashing on me for some reason now. I am not able to figure what is causing it to crash, but i'm attempting to recreate the problem...
written by E_net4 on May 15, 2010 09:31
The game refresh rate looks a bit choppy. Apart from that, everything seems to work better.
written by Cryoburner on May 15, 2010 13:47
The refresh rate should be the same as it was, but is more noticeable now that there's a mouse cursor. It can be increased by adjusting the value of [Milliseconds Per Frame], which is used in the frame limiter loop. 1000 div 60 should make it smooth.

The reason for the crash is that the mouse cursor is getting drawn without checking whether each pixel is within the display area. The initial coordinates are checked, but then the cursor is allowed to overlap off the right and bottom edges of the display. On the right, it just harmlessly wraps around to the left side, but at the bottom, it attempts to overwrite memory outside the display.
written by Jam on May 16, 2010 00:23
(Thanks again Cryo.)

How could I have missed that? I guess I didn't test it throughly enough. Anyways, here's a fixed version:

cd/zips/Jam/checkers02a (27 Kb)

Thanks, everyone, for your posts!

(Also, at what point should I start deleting the old versions? I don't want to waste space, but I also don't want to delete anything that anyone might want to look at in the future...)
written by Mingamango181 on Jul 15, 2010 05:06
I've tried it, and it's quite good so far. I could suggest adding a side bar to the right, so that it could indicate which person's turn it was.

I've noticed how there is a black line on the top and left side of the window, but not on the right and bottom sides.

(I don't think that you have to delete the old versions yet, they don't take much space anyway.)
written by Jam on Jul 15, 2010 16:27
Thanks Mingamango!

I wondered if anyone would mention the missing black lines. It's now fixed.

Mingamango181 said:
I could suggest adding a side bar to the right, so that it could indicate which person's turn it was.
That's been bugging me too... I'll add a sidebar.

Jam said:
If I don't run into any major problems, I'll probably be done in a week or two.
It's been two months and I still haven't finished it. Reminds me of a certain other game we've all been waiting for... But I'm very close... I've added the networking part, I just need to test it.

(You're right, the old versions don't take very much space. I won't delete them.)
reading this thread
no members are reading this thread
. /../Checkers/ 12
38192, 14 queries, 0.375 s.this frame is part of the AnyNowhere network