View Single Post
AvalancheMaster

JCF Member

Joined: Sep 2013

Posts: 89

AvalancheMaster is doing well so far

Jan 7, 2018, 01:46 PM
AvalancheMaster is offline
Reply With Quote
Thanks, that worked!

I'm also trying to make those areas one-way, as well as slide. Is there any way to do this?

So far any attempt to achieve this has resulted either in Slide-only, or One-way-only tiles, depending on the ordering of the code.
Code:
void onLevelBegin() {
    for (int x = 0; x < jjLayerWidth[4]; x++) {
        for (int y = 0; y < jjLayerHeight[4]; y++) {
            if (jjEventGet(x,y) == AREA::SLIDE) {
                jjOBJ@ xenonlight = jjObjects[jjAddObject(OBJECT::STEADYLIGHT, (x*32)+16, (y*32)+16)]; //add in middle of tiles
                xenonlight.light = 20;
                xenonlight.lightType = 3;
                xenonlight.deactivates = false;
                jjEventSet(x, y, AREA::ONEWAY);
                jjEventSet(x, y, AREA::SLIDE);
            }
        }
    }
Also, I am wondering if there is a way to force an animation on a specific frame, depending on player's location. Because my idea is somewhat complicated, let me try to provide an example:

If you have a 10-frame animation, with frames a[1], a[2], a[3], a[4], a[5] ... a[9], a[10], instead of using speed to control the animation, you are using player's position. As the player moves in a positive direction (x and y get bigger), the frames move in chronological order. As the player moves in a negative direction (x and y get smaller), the animation runs in reverse.

When the player stops moving, the animation also stops.

This should apply to all layers, so an animation is the only feasible way I can imagine implementing this.

I want to try to implement faux reflections in a tileset, that's the whole idea behind my question.