# Sloped Tiles

**URL:** <https://forum.kirupa.com/t/sloped-tiles/156503>\
**Category:** programming\
**Created:** [July 26, 2005, 9:30am UTC](https://forum.kirupa.com/t/sloped-tiles/156503 "2005-07-26T09:30:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joppe](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@Joppe](https://forum.kirupa.com/u/Joppe)\
**Post date:** [July 26, 2005, 9:30am UTC](https://forum.kirupa.com/t/sloped-tiles/156503/1 "2005-07-26T09:30:59Z")

</div>

Hello! Im working on a skiing / shooting engine … Basicly a biathlon engine ski shooting…

So i want the map to have some sloped tiles , but it wont work .

I have the map ( a movieclip , instance name : map )  
And inside the map i have a bunch of movieclips ( instance name : slope )  
i think its 6 or 7 slopes in my map and all have the slope instance!  
But as i know from earlier experience i cant use hittest for all “slope” becouse it will only work for one “slope” movieclip.  
So how should i do?

```auto

// x =88 - Z = 90 //
onClipEvent (load) {
    xSpeed = 0;
    left = true;
    right = false;
    power = 100;
    fall = false;
}
onClipEvent (enterFrame) {
    _root.powa.gotoAndStop(power)
    if (this.hitTest(_root.map)) {
        fall == false;
    } else {
        fall == true;
        _root.nextframe();
    }
    if (fall == true) {
        _root.map._y -= 3;
    }
    if (power>=100) {
        power -= 1;
    }
    if (power<=0) {
        xSpeed -= 3;
    }
    if (xSpeed<=1) {
        power += 1;
    }
    _root.power.prevFrame();
    if (xSpeed>=1) {
        this.gotoAndStop(2);
    }
    if (xSpeed<=0) {
        this.gotoAndStop(1);
    }
    if (xSpeed<=0) {
        xSpeed = 0;
    } else {
        xSpeed -= 1;
    }
    if (xSpeed>=20) {
        xSpeed = 15;
    }
    _root.map._x -= xSpeed;
    _root.map2._x -= xSpeed;
    if (Key.isDown(90)) {
        _root.power.nextFrame();
        _root.power.nextFrame();
        power -= 1;
        this.gotoAndPlay("run");
        trace("Z");
        if (left == false) {
            xSpeed += 2;
        } else {
            xSpeed += 0;
        }
        left = true;
        right = false;
    } else {
        if (Key.isDown(88)) {
        _root.power.nextFrame();
        _root.power.nextFrame();
            power -= 1;
            trace("X");
            if (right == false) {
                xSpeed += 2;
            } else {
                xSpeed += 0;
            }
            right = true;
            left = false;
        }
    }
    trace(xSpeed);
    trace('---');
    trace(left);
    trace(right);
    trace('---');
    trace(power);
    trace('---');
    if (Key.isDown(32)) {
        trace(goll);
        ySpeed+1;
        if (ySpeed>=10) {
            ySpeed = 9;
        }
    }
}

```

Thats basicly the whole code  
But how would i add slopes … All slopes… without using hittest a bunch of times?
