ForumsProgramming ForumWorking on drawn-based level editor (As2)

2 1842
mightybob
offline
mightybob
363 posts
1,060

---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!

  • 2 Replies
mightybob
offline
mightybob
363 posts
1,060

Anyone?

bigjacob
offline
bigjacob
581 posts
2,170

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.

Showing 1-2 of 2