Sunday, May 26, 2013

Dominoes: SHIP IT




Ok, I hand-coded a total of 6 puzzles, I've added in some tabbed navigation buttons on the left hand side, I removed the annoying feature of multiple dominoes snapping into the same slot.

I'm calling it good. There may be some bugs, because my data entry skills might not be perfect. There's a lot of bits that I might have cleaned up if I wanted to take more time, but I'd rather have the rest of my weekend, and week, and month to work on other stuff. Or, rather, not to work on anything.

That said, I watched "Safety Last!", a silent movie with Harold Lloyd, and that gave me an idea for a game that I'd like to play around with for June. Maybe I'll work on that tomorrow.


Dominoes - now with a second level




Puzzle #2 is coded and is working.

I started making a JSON parser to construct the puzzle configuration, but at this point, it's just about as easy to do it by hand. Ugh.

I'm not certain there's a unique solution to Puzzle #2. That's a corner I'm willing to cut for the time being.

I dumped out a bunch of dominoes on my desk and I formed the designs for 5 puzzles, plus the trivial one that I started with. 6 puzzles, that seems like enough to call it a game.

There currently isn't a way to navigate between puzzles - that'll come soon, I expect.


Dominoes: Now with level completion


In an earlier post, I claimed that the game was "playable" at some level - assuming the player understood the rules and was willing to enforce them.

This version now knows about the clues, and will indicate if the player has placed a domino in a slot that is clued differently than the placed domino. It also knows about adjacencies, so if you place a domino in conflict with an existing domino, you'll see that.

Also, once all dominoes have been placed, if there are no conflicts, you've found a solution, and you get notified.

So, pretty much, all working. There are a few more things I want to do:

  • Detect if you drop a domino into a slot that already has a domino, and skip snapping the domino into the slot. This should make a certain class of sloppy mouse moves less annoying.
  • Provide a "Reset" button to clean up the board to a start position.
  • More puzzles. I have a few in mind, and it wouldn't be hard to create more. This one puzzle isn't very challenging.
  • Puzzle navigation - once there are multiple puzzles, you'll need to be able to move from one to the next.
Even though the "more puzzles" one is important from the players' perspective, I'm ready to call this one feature complete, and everything else is polish. Which is good - I've got other things I want to do between now and the end of the month.


Sunday, May 19, 2013

Dominoes, now with slots


http://bigdicegames.com/DominoPuzzle/domino.html

Ok, now you can begin to see what I have in mind for this game - it's a simple puzzle game, where there's a series of "slots" (the black outlines), and a few clues (the white numbers). Your job is to put the dominoes into the slots such that the numbers on the dominoes match the clues, and the numbers on adjacent locations match up, much the way dominoes naturally work. You know, dominoes.

In a sense, I've got the game "playable" right now, but there's only one puzzle, and it's pretty simple. And I've given away half of the solution in the above screenshot.

Still to do:
  • provide more actual structure for the outlines - right now, they're faked up for visual purposes.
  • detect if adjacent dominoes match as necessary
  • detect if dominoes match hints
  • detect solved puzzle
  • snap dominoes in to slots
  • more puzzles
  • Fix the numbers - I forgot to create a sprite for the number '0'. Ooops.
Not a lot, I guess - just enough to keep me busy through the end of the month.

Dominoes moving

Ok, so I did a bit of work today on moving some dominoes around. One thing I'm not a fan of is having to deal with multiple different angular conventions - radians vs degrees combined with where 0 is - seems to me, degrees are great if you're a Sumerian and you're trying to manage your crops. And radians, sure, I get radians. But maybe rotations make more sense. Divide radians by 2pi, and you've got something really convenient for most of the stuff I do.

Things remaining to do:
  • slots for dominoes to fit into
  • displaying failed constraints
  • animate dominoes locking into slots
  • content, content, content
You can screw around with the fruits of today's labor here:


Also, it looks like I was here almost three years ago, scratching this itch before:

I'll bet I even have that domino art around somewhere. I think I like it better than what I slapped together in the past few days.




Saturday, May 18, 2013

Small domino game

It's been a few months of small games, and May turns out to be another one. We've launched our project at work, which hopefully means I'll be more able to do some work on games in my free time. Of course, it's getting to be summer, and I've got travel plans, but hey.



I'm going back to an idea I've toyed with before, but never got fully implemented - which seems like a good enough source. It's a domino puzzle game, which is perhaps all I should, or need to, say about it at this point.

Things I did today:

  • created a new domino project
  • created a domino spritesheet
  • cut the domino sprites up, using the Jaws.js SpriteSheet class
  • drew a few dominoes from the cut up sprite sheet
Things I need to do:
  • allow the user to drag dominoes around
  • create "slots" on the board
  • snap the dominoes into the "slots"
  • verify constraints
Not so much to do, but I only have a few days. So, it'll still be a push.

Sunday, May 12, 2013

three.js/WebGL: Go Big or Go Home

I've decided to experiment a little bit with three.js, which seems to be one of the cool ways to get at WebGL functionality without going crazy.

Erm, well...

I decided to start off with the typical spinning box code, but my box textures kept looking like this:
instead of this:
I spent a fair amount of time experimenting with different file formats, inserting debugging code in the texture loader, playing with material parameters, and eventually copying and pasting code from the examples, which worked into my own code. Turns out, and I don't know where the problem lies, between my graphics card, the drivers, WebGL, or three.js, but if your canvas is too small - like 320x240, your textures will have corruption.

OK, now I know.