Jump to content

New game uploaded: GRIDGAME


Recommended Posts

GRIDGAME

View File

(full source available https://github.com/mparson/gridgame)

GridGame

A game for the Commander X-16!

A 'C' implementation of a Flash game I used to play a lot of back in the days of Flash games.

Read about the original game here: https://jayisgames.com/review/gridgame.php

I'd say this game is ~95% faithful to that original game.  Some of the limitations are due to my use of the so-called PETSCII character set for the graphics instead of custom graphics, which means there is no smooth animation of the pieces as they are activated.  I've also not included any sounds, but that might come in a future version.

This is original code that implements the gameplay, I did not port the embedded ActionScript of the original SWF game.

New feature in v0.9.5:

Replayable boards, the "REPLAY" button will reset the board to where it was after the last "RESET", "EDIT" or "LOAD".  Try it again, see if you can get a better score from the same starting board.

New feature in v0.9.

Click on the 'EDIT' button and you can edit the board.

Congratulations, you are now in the most frustrating and feature limited PETSCII drawing program ever.

The boarder changes to '*' from the line-drawing characters. You can now click on a piece to rotate it without triggering a chain reaction. If you click on one of the '*' on the boarder, it will change the entire row or column to match the adjacent piece.

When you 'SAVE' a board, it will not check for a previous file, it will silently overwrite it. Similarly, attempting to 'LOAD' a non-existent board will silently not load a board and return you to the editor.

Click on 'DONE' to play the board.

Why?

Why write this game?  

Well, two basic reasons.  

First, I decided to take another run at picking up the C programming language, and like learning any new language, it helps if you have a project in mind that you want to implement.

Why write for this platform?  Being a fan of the Commodore 8-bit computers and following the development of the Commander-X16, I thought it would be a fun platform to target.

Compiling the code

This was developed with the  cc65 compiler, so, you'll need it installed.  I tend to work with the latest version out of git rather than one of the binary packages, so, YMMV with getting it compile if you use a potentially older version of the compiler suite.

Edit the `Makefile` and fix the paths to the various binaries at the top.

A simple `make` should give you a `GRIDGAME` that you can now load up on an X-16.

It should be a minimal effort to make a C-64 and C-128 version as well, probably coming soon.

Notes on the kwalitee of my code

Yeah, very intentional bad spelling there.  I make no claims to my skills as a C programmer.  This is probably not "good" C code and most definitely not optimized in the suggested ways you should when writing for `cc65` compiler and the 6502 CPU.

Potential features for future versions:

* Versions for the C-64 & C-128
* Sound - I'll need to read up on how to make cc65 generate sounds.  It's documented, but I've not tried that yet.  Step 1 was to get the basic game working.
* See if it will compile with KickC, then all dev work could even be done on the system it is played on!


 

  • Like 1
Link to comment
Share on other sites

New version uploaded, v0.6.  Only feature change is saving high scores to disk.  The save is triggered at the end of a run if there is a new high score.  Happens very quickly, all you'll really see is a blink of the drive activity indicator in the top-right corner, if you're watching for it.

For giggles, I tried compiling it with '-tc64'

Under vice, once I figured out how to make the mouse work, it was surprisingly fast.  The mouse movement was all wobbly and jumpy, but, for the most part, it worked.  Saving the highscore file takes a few seconds, but not terribly long.

Tried it on my MiSTer's C-64 core and the mouse was nice and smooth.

Both environments (vice & MiSTer) did weird things though.  There were strange character artifacts that popped up in a few places during game play, and I'm pretty sure something was going goofy with the processing of the queue of which pieces to rotate, as I was getting WAY higher scores on the C64 version, probably due to the queue filling up and wrapping.  I've not spent any time trying to debug it, just thought it was interesting.

I'm guessing the character artifacts are due to screen memory getting overwritten, might be able to solve that by digging into the cc65 best practices on variable handling and seeing if I can tune that up a bit.

Next feature to work on: Board editing (with saving & loading).  I worked on the high score stuff first since I figured it would be a good way to learn how to open,read/write or remove, and close files.  That turned into an adventure of its own.

Link to comment
Share on other sites

New version upload, v0.9.1 - Board Edit Edition

Click on the 'EDIT' button and you can edit the board.

Congratulations, you are now in the most frustrating and feature limited PETSCII drawing program ever.

The boarder changes to '*' from the line-drawing characters. You can now click on a piece to rotate it without triggering a chain reaction. If you click on one of the '*' on the boarder, it will change the entire row or column to match the adjacent piece.

When you 'SAVE' a board, it will not check for a previous file, it will silently overwrite it. Similarly, attempting to 'LOAD' a non-existent board will silently not load a board and return you to the editor.

Click on 'RESET' under the HIGH SCORE and your HIGH SCORE will be reset to '0' and saved.

Click on 'DONE' to play the board.

None of the stuff around saving/loading works unless it is run from an sdcard.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

Please review our Terms of Use