cjsmith: (cjre joe2)
cjsmith ([personal profile] cjsmith) wrote2004-03-07 11:16 am

Pixies

I've spent way too long lately herding pixies. (My personal best: 46. My usual score: seventies or eighties. My most common reaction: "YOU LITTLE @#$! GET OUT OF THERE! YOU CHEAT! YOU LITTLE @#$!ING CHEATER!")

The little dots representing pixies bounce off walls in a fashion that is not QUITE perfectly symmetric. They seem to prefer getting stuck between a pair of corners. This is what I'm screaming about when I yell at the screen that they are "cheating". I am also positive they gravitate toward where the mouse is pointing, but I can't prove it. ;-)

Anyhow, after I play a few games, Java goes into what I can only guess is infinite garbage collection mode, and everything runs veeeerrrrrryyyyy slllloooooowwwwwwllllyyy. Exiting the browser fixes it. This is annoying. The popups and animated ads all over the screen are also annoying. I don't always have a net connection when I travel, making it impossible to play while taking a break from square dancing in Los Angeles; this too is annoying.

So I wrote my own @#$! pixie game (C++ and MFC). (Believe me, MFC is hard to use when you have no help files and no experience.) My pixies don't cheat, though. I don't know how the other folks made the pixies cheat like that. This has advantages, in that any place a pixie will bounce into he'll eventually bounce back out of, but it also has disadvantages: the pixies in my game don't bunch up, making the endgame harder.

Yes, Your Honor, it's true: I have no life.

[identity profile] hitchhiker.livejournal.com 2004-03-08 12:14 am (UTC)(link)
I'll take writing (anything) over a life any day :)

[identity profile] cjsmith.livejournal.com 2004-03-08 09:16 am (UTC)(link)
*grin* Sometimes I miss having a life, though.

[identity profile] hitchhiker.livejournal.com 2004-03-08 09:35 am (UTC)(link)
(:

Have you seen SDL (http://www.libsdl.org/index.php)? Finally decided to d/l and give it a try (downloading as we speak) - it's certainly a lot less masochistic for 2d game programming than MFC :)

[identity profile] joedecker.livejournal.com 2004-03-14 08:58 am (UTC)(link)
I thought about the cheating, and it might be a coding bogon instead of an intentional effect. If they move the pixie some distance (d) on each step and then check for collisios in the x and y planes separately, and flip direction on both collisions if both trigger, as d gets large they'll get more and more bouncing off of sharp corners (something that would happen only infinitesimally often in the Real World TM.)

[identity profile] cjsmith.livejournal.com 2004-03-14 09:51 am (UTC)(link)
I'm nearly certain that it got in there as a coding bogon instead of an intentional effect. However, if I had that same coding bogon myself, then fixed it, I could see adding it back in deliberately because of its effects on the game.

I found that I had to check for collisions every d=1, because otherwise I had pixies fly into walls and embed themselves there. Oops. :)