Sliding around

There was a lot of failure earlier in this gruedorf-week attempting to import verge3′s obstruction and player movement system into spriteright. That failed a lot. The transliteration of C into javascript largely was mechanical, but the truth of the matter was there was far too much for me to convert at one time before I saw a physical return,so the bugs were legion.

I was impressed how easily I could convert C into javascript, though. And I learned that javascript had bitshifting operators!

I really didn’t expect that for some reason. Most likely because ints aren’t supported natively in the language.

At any rate I threw out most of the code and started again anew, and worked towards an obstruction system that I couldn’t walk through the walls of. And I got there tonight!

Then I started implementing an obstruction system that’d let me slide around on the diagonals. And I got there tonight!

But the hack I used to get the diagonals-sliding lets you get embedded in and/or walk through walls again. So that’s got some bugfixing in it’s future.

The important part is: it feels fun again, and I made visible progress.

I also implemented an autoexec script for maps upon load (mapinit) and shoved a few setObstructionTile calls in there to make the map easier to navigate (specifically, to make it easier to get into and out of the hut).

So that’s neat.

Press ‘O’ to see the obstructions while you play!

Go see SpriteRight in action!

Or maybe check out it’s source at github.

Also read...

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>