Sidescroller

by Forum_account
[Share] [Zip]
ID:112155
 
I've been trying to post an update at least once a month, so here's the one for April. There are two main changes:

1. The atom.flags var was added. This flag is a bit mask that you can use for whatever you'd like. Instead of just setting the mob's flags (on_left, on_ground, etc.) to zero or one if the mob is next to a dense object, the flags are binary ORed with the flags var of each atom.

Two examples of how to use this are included in movement-demo. The examples are icy floors and walls that aren't climbable.

2. I changed the way backgrounds are handled. You can now have multiple backgrounds displayed for the same player at the same time. The library also makes backgrounds automatically loop. If you scroll the background too far to the left it'll be repeated.

This required a slight change in how backgrounds are created. The mob.background proc creates and returns a /Background datum. The datum has two procs, show() and hide(), which control the display of the background. Each /Background datum is for a specific player. The mob's background() proc takes a second argument which tells it how the background will scroll, it's values can be zero (for no scrolling), SCROLL_X (for horizontal scrolling), SCROLL_Y (for vertical scrolling), or SCROLL_X + SCROLL_Y (for both).
Shortly after posting this update I realized that atoms should have a way to define flags for individual sides. I added this to the library but didn't upload the change yet.

I also got an idea for a new library that might help with camera control. I'm afraid there might be some performance issues (it'd run fine, it just might take a while to load) so I'd like to try some things out first. If I get something working I might post another update this week.