Friday, August 16, 2013

Project 4: Snake Version 0.3.0 (Almost Undetectably New!)

The Snake game has still been holding my attention, so I've put together the newest update. This new version however is primarily changes to the design and organization of the game.

Does this mean you won't be able to tell the difference from version 0.2.0? Not entirely. The new structure has made it easier for me to switch things in and out and make things a little easier.



The biggest change is that now the controls are modelled after those implemented in Nibbles. This means that when you're heading in any direction you can now only turn to the side rather than back on yourself. However if you liked the original controls, all you have to do is press 'k' to switch between the two controls.

Furthermore if you want to make things easier or harder on yourself there are some cheats available:

  • Press 't' to add a point to your score, this moves the target and is just like you hit the target on your own.
  • Press 'y' to add a level. This levels you up, speeding up the game.
  • Press 'u' to turn off collisions, so you can go on forever without worrying about running into yourself. Press 'u' again to turn them back on again.
That's pretty much the update for this time. Lots of changes that mean more to me than you, but it should make it a lot easier to do the things I'm thinking for the future. Speaking of which Version 0.4.0 will be along in a little while and should bring a GUI and different kinds of worlds to play.

But for now you can download Version 0.3.0 below:

Edit: See the Patched Version 0.3.1
  • The Windows Versions (32-bit, and 64-bit)
  • The Mac OS X Version Edit: There seems to be a problem with the Mac OS X app. I will investigate as soon as I can.
  • The Linux Versions (32-bit and 64-bit)


2 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Mr. Putter's Random comments:

    >Woohoo! 88 points! #obligatoryBTTFreference

    Congrats.

    >I refuse to divulge the embarrassingly long time I've been sitting here and playing in order to make it that far.

    Fair enough.

    >Not that this makes any difference to anything that I can figure; I'm just curious: whyfor is the (Windows) 64-bit version a .bat file and the 32-bit a .exe file?

    Processing.org does it that way. I have no idea why.

    >Just FYI: on startup I'm seeing the following strangeness in the command console window:
    > ==== JavaSound Minim Error ====
    > ==== Couldn't find a sketchPath method on the file loading object provided!
    > ==== File recording will be disabled.

    > ==== JavaSound Minim Error ====
    > ==== Couldn't find a createInput method in the file loading object provided!
    > ==== File loading will be disabled.
    >This happens both 32- and 64-bit Windows versions. I can check the Linux versions when I get home... if you care? Sounds seems to be working fine anyway, though, so *shrug*.

    Aha! I've been getting part of that error message and was wondering what it was about. I suspect some of the early messing around I was doing with the synthesizer that generates the beeps. I'll look at it.

    >Pressing “t” before the game starts: sudden death? (Fair enough, I s'pose; I was just a bit surprised, and uncertain whether it was deliberate or accidental.)
    >Pressing “t” twice before the game starts: see above.
    >Pressing “t” THRICE before the game starts: yeah, don't do that.
    >Pressing and holding down “t” while in the middle of a game: yeah, really don't do that.

    Well that's exciting. I'll look into it. Before the start it's probably the collision detector realizing that the snake is over itself. The others I'm not sure about.

    > Has it always sped up as you progressed or is that a new addition? I don't remember whether that was the case or not. Man, by the time you get to about level 8 it's pretty brutal.

    Yup and yup. Been thinking about the balance there. Once you reach level 9 the speed is the maxed, but see below why I'm not sure about how I want to handle all that.


    > At lower levels (up to about level 3 or so) the keys feel a bit “sticky.” Or perhaps the opposite of sticky? It seems like I'm often pressing a key only to not have it register. As I wrote above, this goes away somewhere around level 4 and it gets a lot better. I didn't look into the code to investigate at all. But I... could?

    Yeah. This is because the key presses don't correspond to the movement of the snake. In effect they set a flag that the snake will follow next time it moves. As far as I can tell this is how the implementations I played worked. (At least most of them, I'm sure there's a smother way to handle it, but the fact remains that the speed of the snake isn't related to the controls.)

    At level 3 or 4 the snake is moving about 12 times a second (if I'm doing my math right) which should feel like a normal reactivity (at level 8 it's moving close to 30).

    One thing i'd like to do is decouple speed from the level (or at least let people set their own speed to begin with, getting over that awkward phase. I can also average the acceleration out over the length of the game to "victory" but given that the highest score anyone can get is 399 (with the current set up anyway) this also seems awkward.

    > Turning off collision detection, then cranking the snake length to something ridiculous (e.g.: a couple hundred) results in some neat patterns emerging on the screen as you try to contol the sucker. Add in some colourization, and it could totally be a Piet Mondrian generator!

    Hehe. Agreed. Although technically we've already covered that in my research group.

    ReplyDelete

Reading

I’m not sure that anyone, myself included, really needs this post. On the other hand, I read a thing about re-reading and I want to write ab...