[rfk-dev] [ANN] robotfindskitten - Native Mac OS X version

Dave dgriffi@cs.csubak.edu
Sat, 19 Apr 2003 23:10:20 -0700 (PDT)


On Sun, 20 Apr 2003, Phillip Ulrich wrote:

> You read that right - I finally got off my arse, rewrote the important 
> parts of rfk in Objective-C for native-ness purposes, and am making it 
> available as a user-friendly, double-clickable Mac OS X app.  Now 
> robotfindskitten can even be played by those OS X users afraid of their 
> own terminal.
> 
> Small points of contention:
> - You don't so much touch an NKI as run over/through it.  This is 
> because, really, there's not any way to tell if there's anything drawn 
> there, because I'm not using ncurses.  As soon as I find out how to do 
> this when drawing strings to a view, I will.
> - Some NKIs will appear in the same spot.  See previous point.
> - robot is white, kitten and NKIs are red, field is black.  This is 
> sheer laziness; the next release will allow customizability to the max.

Based on how I implemented RFK in Inform, here are some hints:

Collision-detection:
I implemented NKI placement by having two arrays; one for the x and one
for the y coordinates.  On every move, you compare the robot's new
coordinates with those of the kitten.  If they match, do the endgame
sequence and return to the main menu.  If not, go through the NKI
arrays, comparing each coordinate pair with the coordinates of the
robot.  If they match, then move the robot back where it moved from. Get
that NKI's message number and call the function lookup_msg() which
returns a string for the number which is then printed.  This coordinate
array allows one to easily avoid the problem of NKIs being placed on top
of each other. For reasons still unknown, in the Inform version, robot
will occasionally get placed on top of an NKI or even kitten.

Colors:
Robot is always white.  Another array is used to store the color
assigned to each NKI.


> - http://www.interalia.org/icon2/software/screenshots/xrfk3.jpg

This one appears to not exist.


-- 
David Griffith
dgriffi@cs.csubak.edu