I’ve been tinkering around with physics and things bouncing off of other things, and discovered the game crokinole so I thought it would be a perfect fit for Codea and what I’d been doing with Codea anyway.
This prototype is more less “done”, though it does have its problems and would not be considered “done” if we were calling it anything but a prototype. Known issues are at the bottom of this post.
To play you’ll need to either replace the caroms and one of the game board sprites with basic ellipses of the proper dimensions, or go ahead and download the carom and board at these links:
- brown carom - https://www.dropbox.com/s/5gsun57iy46b088/brown%20carom.png
- white carom - https://www.dropbox.com/s/879kzux99zqkzuf/white%20carom.png
- board background texture - https://www.dropbox.com/s/p503nspn4osyjsl/Woodgrainbackgroundvectormaterial1.png
Rules can be found here.
And here is a video of me giving the nickel tour.
And I’m putting the code at this link because my post is apparently 12,389 characters too long!
Sorry if there’s some way to embed links and video that I’m not aware of, and for the wall of text.
Thanks for reading and playing, if indeed you have, and enjoy!
Addendum - known issues (probably not an exhaustive list):
- scoring: something is off but it’s not consistent. Shorter games (you can adjust how many caroms each player gets in the gameInit() function) seem to always score perfectly, full games (12 caroms each) frequently score incorrectly for at least one player. Haven’t tracked that down yet. Also scoring at the end is not displayed per the rules, it should be the player who scores the most actually gains in points the different between the two scores, but that’s such a trivial change I haven’t bothered to code that. I just display the two scores (otherwise I never would have known there was a scoring problem anyway).
- restarting a game: touching the “game over” screen is supposed to restart the game, and it does… mostly. It seems that physics bodies from the prior game remain, which I can’t figure out because I’m marking them as “dead” and calling the same culling function at the end of the game to remove “dead” bodies.
- it’s a rat’s nest: you’ll notice an almost allergic absence of “returns”. Every class and function is painfully “aware” of the existence of others. It’s a problem I can fix now that I’m a bit more proficient and have an understanding of why it’s not the best way to do things. It’s probably also contributing to my inability to find the first two bugs on this list. I’m not the most efficient coder yet, so for the most part I just did what worked and moved on to tackle other problems. I’m sure you’ll see something and go “why the hell did he do THAT?”
- I also have no doubt there is tons of vestigial stuff in there from different dead ends and rabbit holes I went down in creating the game. I also copy and pasted some of this from my other projects and probably didn’t clean it all up. It’s a prototype!
- graphics - it’s a prototype so it gets the job done, eh?
- Rules: The broad strokes of the game are correct, but I’m sure I’ve missed some of the more subtle details in the rules. I’ve never actually played the board game so if any rule is missing it’s purely because I don’t know about it or didn’t read the rules carefully enough, not because the logic in the code is wrong. That said, I do sometimes see the game do something a LITTLE bit wrong, but it’s rare and happens sometimes so fast that I can’t decide if it was incorrect logic or if I just blinked and missed the action on the screen.