my first game =D


xafier

Member
Joined
Dec 28, 2003
Messages
313
Age
39
Location
Sheffield, England
Website
www.xafiers-home.com
Well this is my first attempt at making a game... Noughts and Crosses :D

the controls are pretty easy... on the main menu, up and down to select the game type... the selected item is the one in white font... press start to start...

once in the game L+R goes back to main menu, D-pad moves the mouse... B selects the square... and if theres a message box, press A to close it...

there are few bugs in it that I know of but can't sort out...

[edit 5th Jan]

the only thing not working now is the vs computer section... it seems to randomly crash as described in the post further down!

well, any comments, solutions to bugs... new bugs? thanks... I know its a sucky game, but it's my first one and I'm not gonna write Doom for my first game am I? lol :D
 
well done - Your C skills are already better than mine :)

I'm gonna do my darndest to catch up though!
hehe, my C skills aint that good... I've only been learning C++ for approx a few months... with horribly basic lessons at Uni <_< I've just done programming before... in quite a few languages at a basic level, so I understand the basic logic behind programming... its just learning the syntax thats an arse...

especially when programming for a console... cus there's so much more effort to printing out a string like "hello silly world!"... but oh well... it all comes with practise man :D
 
Last edited by a moderator:
do i need anything else instead of hte image folder and the fxe file? or do i put everything on my GP32?

Edit: tic-tac-toe?
 
I don't have my gp32 handy so I can't test the game, but quickly looking through the code it seems as though you may have some char*'s that haven't been malloc'd. This will almost certainly cause you problems (you'll be accidently overwriting memory) and may be the cause of the random resets. Also, isn't 133mhz a little excessive for noughts and crosses ;)
 
you may have some char*'s that haven't been malloc'd

and that means? :blink: being kinda new to C++ I'm not sure, be nice if you could explain... having used VB and Delphi/pascal in the past I'm used to strings not char* :D

Also, isn't 133mhz a little excessive for noughts and crosses

i wasnt sure what other settings to use, i read through a few tuts and they all used that so meh... thought i'd be safe and stick to it... i know the standard is 66mhz right? but not sure how to represent that as a whole figure... is it a bit specific?? plus some bits and bobs are stole from my attempt of Pong 32! (still in development due to some probs with sin and cos) cus i like saving time with code if at all possable... if its re-usable and it exists, use it!
 
A * is a pointer to an object. In the case of a char* you've created a pointer to an array of char's, but you've not allocated the memory to that array so anything else can come along later and write over the memory. You should either use malloc on the object (find a book or tutorial, I'm a crap teacher so I won't even try), or preferably use char stringname[stringlength] to give the string a fixed size.

As for clock speed, I use the table in this topic http://www.gp32x.de/board/index.php?showtopic=1370
 
Last edited by a moderator:
Just don't set the speed, and the GP32 will default to 40MhZ - the lowest speed, which would be perfectly good for tic tac toe :)
 
I made some new GFX for you.... i can send you them if you want...
yeah sure, my emails on my profile :)

the files now available from:

http://homepages.shu.ac.uk/~kmwragg/GP32.html

I've found and fixed the bug in the computer section... it was to do with the random selection part of the computers move... silly me... oh well...

theres still the problems with score output when played on the GP32, but runs fine on geepee32 :) once I understand pointers and stuff better I should be able to fix it... but meh... my head hurts from trying to find that one little bug ALL day... I cant believe it was something so simple as writing

num = rand() % 8;

instead of:

num = rand() * 8;

see, thats what you get porting from different languages... stupid little bugs!! gahhhhhhhhhhhhh

anymore bugs ppl find, let me know :) else I call this little project of mine totally into the "pretty much done" stage :D
 
Last edited by a moderator:
Back
Top