Page 1 of 1

'Mario' source code

PostPosted: Jun 21, 2003 @ 10:18am
by Dave Johnston
By request, I've uploaded the very messy source code to my 'Mario' game to:
http://www.omnytex.com/pf/fileexchange/fileexchange.asp

I have to admit I just zipped up the files and am crossing my fingers, hoping it'll all work! 8O

Here is the included readme.txt file:

'Mario' source code
"""""""""""""""""""

*** REQUIRES POCKETFROGPLUS ***

This is the source code to a 'Mario'-style game that I wrote in late 2002. It features platforms, animated sprites, parallax scrolling background and sound to name a few things, along with some basic collision detection. Look in the code hard enough and you'll find it can also handle sloping platforms! (well, just)

The source isn't well documented, and isn't particularly nice either. Those with Half-Life coding experience will notice the inspiration of naming (BaseEntity, BasePlatform etc...) and interfaces/methods. I adopted it for this since, well, I like it :)

Speaking of uhh, 'inspiration' - some code has been directly 'inspired' (read: copied). There are a couple of SetThink SetTouch lines which come straight from Half-Life, and there is also a 'trace' method for spotting intersections which came from some webpage I forgot to note down. Credit to whoever it was...

Other things to note:
- the game is mostly all done floating-point, but still gets half-decent FPS!
- there is some fixed-point code, but it isn't used (as far as I remember) - nor is it very tested
- the mario sprite is (C) Nintendo
- code is messy and largely uncommented
- all other graphics are original
- lots of things may be broken or not work... remember this is an alpha that I abandoned due to lack of time

That is all for now! I hope someone makes some use of this mess of pointers and classes...

- Dave Johnston
- dave at johnsto d0t co d0t uk
- http://www.johnsto.co.uk/pocketpc/

PostPosted: Jun 21, 2003 @ 8:11pm
by Datalore
Thanks for releasing the source Dave. Do I have your permission to upload the binary on file-exchange so people can test it out without compiling? It took me about a half-hour to compile, as I've never used PocketFrog or WCE3.0 or anything. Your original readme will be included. The binary I would be uploading is just a straight compile of your source, with only a few minor modifications made to make it compile.

Modifications made:
In game.rc it pointed to image7.bin and image8.bin. Those files didn't exist, so I just guessed as to what they should be.
<<One of them points to the clouds and if it isn't the right bitmap, the whole game is screwed up. The other one points to the sky bitmap, which I cannot find, but does not affect gameplay. (Theres only a pink sky)>>

I get 19-21 FPS on my Axim X5 400.

P.S.- What was with the Phootball thing? :D

PostPosted: Jun 21, 2003 @ 8:51pm
by Dave Johnston

PostPosted: Jun 21, 2003 @ 9:57pm
by Dave Johnston

PostPosted: Jun 22, 2003 @ 12:14am
by Datalore
I have no idea how to turn on these optimizations you speak of. Here's an unoptimized version that I was able to keep pretty small by cutting out unused images. So far this Mario game looks pretty cool.
It had an identity crisis though, as it looks like it could have been either Phat Soccer, Phat Football, or Sonic the Hedgehog instead.

I fixed the pink screen issue. I don't know if I'm getting 20 FPS because of some Dell Axim issue or because I don't have a clue on how to optimize. Can somebody with an Ipaq/other PDA test this? Just report your FPS. Thanks.

File is at

PostPosted: Jun 22, 2003 @ 12:17am
by Dave Johnston

PostPosted: Jun 22, 2003 @ 12:18am
by Dave Johnston

PostPosted: Jun 22, 2003 @ 12:21am
by Datalore

PostPosted: Jun 22, 2003 @ 1:31am
by Thomas

PostPosted: Jun 22, 2003 @ 2:07am
by Datalore

PostPosted: Jun 22, 2003 @ 2:26am
by Thomas

PostPosted: Jun 22, 2003 @ 1:06pm
by Dave Johnston

PostPosted: Jun 22, 2003 @ 4:54pm
by Datalore

PostPosted: Jun 22, 2003 @ 10:55pm
by Datalore
I'm going nuts. First of all, I can't figure out how to redefine the levels. Second, I don't know how to simply put an object on the field. I'm getting this:
Image
Any ideas, Dave?

PostPosted: Jun 23, 2003 @ 7:45am
by Dave Johnston