Jump to content
Sign in to follow this  
gozar

Best practices in Action!, mirror players?

Recommended Posts

I'm working on writing my first game in Action!. It's a two player game, and the players are identical except that they are mirrored. I'm storing the shape data in a BYTE ARRAY, is there a trick to flipping my player?

Share this post


Link to post
Share on other sites

In terms of speed it's probably the quickest, in terms of memory not the best but 256 bytes + the programming requirement isn't much.

 

Essentially you just use the original data as an index into the array, then store the looked up array entry into the graphics for the object.

A more memory efficient way is to just use a 16 byte table and operate on each nybble at a time.

But the saving isn't quite as much as you'd think as it's extra programming and execution time, so a 256 byte table is probably best by far.

 

So, your lookup table would look like (index, entry) - first 4 and last 4 in hex:

 

00 00
01 80
02 40
03 C0
..
FC 3F
FD BF
FE 7F
FF FF

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...