Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jplindstrom (594)

  (email not shown publicly)

Journal of jplindstrom (594)

Monday April 12, 2004
03:48 PM

The Worm Crawls

[ #18302 ]

My Worm game is now in a playable state. Ok, it's not Half-Life II (the physics engine isn't quite... eh... done yet), but the gameplay is actually pretty ok after a few days of implementing stories.

On the Lawn there are Walls obstructing the way of your Worm, and Worm Bots compete with you for the Prizes (the $ signs). Future stories include areas of SlowSand where the speed is reduced.

The Worm Bots roaming the Lawn are semi-clever when it comes to catching the Prizes, using an opportunistic approach of trying to turn towards a Prize when they pass next to it. But it works, and if there are three Bots on the Lawn with you, they might even collect more points than you.

I currently use Win32::Console for the display, so it's not very cross-platform. I tried installing Curses and found a PPM after some digging, but some (I think) important calls in the demo programs didn't work, so I don't think I can use it as-is for win32. Maybe if I create an OS abstraction layer someone could help me port the few calls needed?

I'm also thinking of a Tk UI to get it cross-platform, but I'm pretty Tk-illiterate. Is there a some kind of grid-widget that resembles how I treat a console? (i.e. write a char at x/y). Is there a way to get keyboard input? Or maybe I should take the opportunity to take a look at wxPerl.

Source and a freestanding .exe (no Perl required) here if you want to try it out:

Have fun!

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I presume this is GPL? In that case I will soon be borrowing your code to make it playable for my daughter :)
    • "Same as Perl". Whatever that means to you :)

      What do you intend to do with it?
      • as you may know my daughter can't use a keyboard or a mouse, because of her disability. Currently all she can do with her computer is using it as a communication device (using pVoice), and she uses it to listen to/read books (using pStory).
        I'm now working on pTetris (based upon Games::Tetris) to give her a game to play, and I think this game would be a welcome addition...