Friday, July 20, 2007

Day 4 - Is the earth flat or doughnut shaped?

A few hours this evening. Nice to be back in 8 bit land. No interlude yet, it was a busy week at work with little time for side interests, so tonight's work was spent on the main game. You may remember Day 3 was a bit of a mess, so I rewound a little and added got things working a lot more simply this time. I'm still using the coarse collision detection as that's just tidying up which we can save until later. For the moment it's all about getting a 2nd generation reflection.. (beam enters facing left from top right.)

Success! ..But.. I get multiple reflections now, but strangely the beam stops prematurely. I have code to determine when the beam hits the edge of the screen, but somehow it also seems to hit something at other times. Either I've discover a dark matter detector, my world is a torus, or there's a mysterious bug in my code. I suspect the latter at the moment, but I'll update you. Most evidence seems to suggest it's when I cross the centre axis, i.e. as my "sign" changes. I'm using an ADDD with a BVS check which I need to ponder on whether it's the right choice. Usually naughtiness when you start bending signed and unsigned usage and checks (tut.) No doubt the solution will dawn on me shortly. Once this beam reliably hits the edge of the screen (or a consumer) I'll be moving on to improving the object handling. Oh that reminds me, you might have noticed a change to the layout. I added a 4th object (all 4 are now reflectors.) I removed the auto spin feature of the 2nd object and added an object select feature to allow me to rotate the reflectors independently for debugging (or maybe a more lasting reason..) You'll also note that one of the boxes appears brighter, this indicates which is selected for rotation (cycled with B1 & B2.)

Compiled code size 5182 bytes


Steril707 said...

Ah, it's gettting a little bit clearer now..;)

On the sign/unsign thingy, how about just using 0-255 and then subtracting the x's and y's with 128 when you draw the whole stuff to the screen? Thats how i usually do this, and it keeps me from getting completely crazy and mad..

La Mike

Anonymous said...

I'm still trying to figure out what you're aiming for with this.... the only thing I can think of at the moment is some sort of Laserchess game? Am I warm?


Vectorzoa said...

Hi John, Laserchess? If I knew what it was I'd let you know! :)

[ a quick google ]

Hmm, definite similarities to my (supposedly) original concept..

I guess we'll have to find out as it evolves. So far differences I can see are:

1, SW has no gridded movements.
2, SW allows rotation to any angle.
3, In SW Players don't take turns to move.

I don't think I'll explore Laser Chess any more for now, I prefer to remain "uninfluenced" :)

We can compare them nearer the end!

(They say there are only 6 stories, I guess there are only a few games too!)