Forums

ForumsProgramming Forum

Working on drawn-based level editor (As2)

Posted Oct 16, '13 at 7:09pm

mightybob

mightybob

353 posts

---As2---

For my game I want people to be able to create their own levels. And I want them to be able to be as good - and if not better as the levels all ready in the game.

So one of the problems is that the code I wrote to let you draw, draws choppy and hard lines. Which doesn't look good at all, plus leads to glitches.

I need it to be really smooth.

Also another thing I'm scratching my head about is that I need some way of wall detection. Like if the mouse is going at an 85 to 95 angle, it stops drawing in the "ground" symbol, and starts drawing in the "wall" symbol. That way, the player has no extra work to do when making their level, but it just auto-maticly switches to drawing in the wall symbol, and the player won't even notice. Of course usually you could just add wall detection to the ground, but my game has a lot of steep hills, slopes, so that wouldn't work.

Plus I can't seem to find an As2 of making a color picker. I tried getting out the built in one, but of course as soon as you need it it's gone! And I got no idea where to re-download the components.

So here's the code:

var createLine:Boolean = false;

this.onMouseDown = function() {
    createLine = true;
    if (createLine)
    {
        this.createEmptyMovieClip("line",this.getNextHighestDepth());
        line.moveTo(_xmouse, _ymouse);
        updateAfterEvent();
    }
}

this.onMouseUp = function() {
    createLine = false;
}

this.onMouseMove = function() {
    if (createLine)
    {
        line.lineTo(_xmouse, _ymouse);
    }
    updateAfterEvent();
}

this.onEnterFrame = function() {
    line.lineStyle(50, 0x000000, 100, 0, 0, Round, Round, 0);
}

Thanks!

 

Posted Oct 18, '13 at 9:37am

mightybob

mightybob

353 posts

Anyone?

 

Posted Oct 21, '13 at 4:53pm

bigjacob

bigjacob

457 posts

The sad thing about this sub-forum is that there are more people asking for help with codes and their games in progress than people that can help. Wish I could help, sounds like a fun game concept.

 
Reply to Working on drawn-based level editor (As2)

You must be logged in to post a reply!