Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Hands On AGK: Tic Tac Toe

Author
Message
Talairina
18
Years of Service
User Offline
Joined: 9th Jan 2006
Location: United Kingdom
Posted: 26th Dec 2013 08:12
I figured I'd go back to trying out some AppGameKit after the my last attempt last year so picked I picked up my copy of Hands On AppGameKit and started working through the chapters again. I've got up to Chapter 21 which is network a 9x9 Tic Tac Toe game. Now after testing the game I've noticed two issues;

#1 - When a player take's their turn the X/O is placed off the left of the board on the receiving games screen i.e. it is incorrectly placed. Ive checked my code repeatedly against the book and it seems to match but chances are I'm missing something here.

#2 - After the 4 placement i.e. end of turn 2, the game will crash on PC or lockup on AppGameKit Player on Android and iOS with image error related to UpdateScreen specifically



I've included my hand typed code below but I can't provide images as I'm unsure of the distribution license on those.

What I'm hoping for it someone to come in and ay Tal, your an idiot you mistyped 'blah' or something along those lines =p

JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 26th Dec 2013 08:58
I don't think you've created sprite number 2...

-- Jim - When is there going to be a release?
Talairina
18
Years of Service
User Offline
Joined: 9th Jan 2006
Location: United Kingdom
Posted: 26th Dec 2013 09:22
Quote: "I don't think you've created sprite number 2..."


There is no sprite 2 mentioned in the book and I don't believe having no sprite set as '2' should matter to my problems listed.
AlistairS
11
Years of Service
User Offline
Joined: 28th Apr 2013
Location: U.K.
Posted: 26th Dec 2013 10:43
I'll take a look at the code and get back to you ASAP.

I know from bitter experience that what happily ran in one version of AppGameKit can cause problems in other versions so perhaps that is the cause. I certainly tested the program several times when I wrote it.

(Feel free to post any resources from the book)
Talairina
18
Years of Service
User Offline
Joined: 9th Jan 2006
Location: United Kingdom
Posted: 26th Dec 2013 10:47
Quote: "I'll take a look at the code and get back to you ASAP.

I know from bitter experience that what happily ran in one version of AppGameKit can cause problems in other versions so perhaps that is the cause. I certainly tested the program several times when I wrote it.

(Feel free to post any resources from the book)"


Much appreciated AlistairS. I actually own both the AppGameKit book and the two DBP books in paperback. I think they are great as a reference library and have some brilliant examples in them. Always end-up going back to them when I have not touched DBP/AGK in awhile to help refresh my memory.
Lucas Tiridath
AGK Developer
16
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 26th Dec 2013 10:49
I think this is your problem.


Typos are a real pain in AppGameKit BASIC because it just assumes that you want to create a new variable sqaure with value 0 and return it. Just change that to



at the end of your GetMove function and all is well .

Talairina
18
Years of Service
User Offline
Joined: 9th Jan 2006
Location: United Kingdom
Posted: 26th Dec 2013 10:57
I knew it would be something so trival such as a typo. Horrid little buggers. Guess they escape through when you up at 4am coding =p

One fixed typo = both problems solved. Thank you very much everyone for your help.
AlistairS
11
Years of Service
User Offline
Joined: 28th Apr 2013
Location: U.K.
Posted: 26th Dec 2013 11:55
Lucas beat me to it. I should have looked back here to save myself the effort

I'd just like to say that if anyone has any problems with examples in the Hands On AppGameKit book, please contact me and I'll give you as much help as I can. You can get me at alistair@digital-skills.co.uk.

Glad you like the books, Talairina. I'm busy working on an upgrade to Hands On AppGameKit BASIC at the moment to add all the new statements available in AppGameKit v 2.
Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 26th Dec 2013 12:04
I think we have another champion for Option Explicit. Seriously, variable typos make up 90% of my bugs and make using agk/dbp needlessly frustrating at times.

Lucas Tiridath
AGK Developer
16
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 26th Dec 2013 13:18 Edited at: 26th Dec 2013 13:20
Quote: "Thank you very much everyone for your help."

You're very welcome .

Quote: "I think we have another champion for Option Explicit."

Agreed.

@AlistairS
I've never spotted you on the forums before but as you're here, I'd just like to say thanks for the books! I don't actually have your AppGameKit book but I learnt to program from your two DBP volumes and I still program with your Java and C++ books beside my computer. Seriously they're some of the best books for learning to program I've tried. I just lent my copy of Hands on C++ to a friend struggling with OO having coming from a procedural background and he now swears by them too.

AlistairS
11
Years of Service
User Offline
Joined: 28th Apr 2013
Location: U.K.
Posted: 26th Dec 2013 14:37
@Lucas Tiridath,
Thanks. It's much appreciated! Tell your friend I'm working on a second edition of the C++ book.
I do post here occasionally if anyone on the forum has any problems with the AppGameKit book.

Login to post a reply

Server time is: 2024-11-24 23:42:35
Your offset time is: 2024-11-24 23:42:35