A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: I need some actionscript maze help

Hybrid View

  1. #1
    Member
    Join Date
    Oct 2004
    Posts
    75
    holy moly mother of god thank you so much! This is by far the most help I've ever gotten from any forum for anything! Works great i'll try tweaking the code a little bit and making a game from this.

    I'm gonna put in a timer to see how long it takes to get through the maze and the time you did it in and minus the times and thats the points you got. This maze took me approxometly 30 seconds to make so I'll be more careful and make'm a little better and make a whole bunch. If I get done soon I'll put on the final product so you guys can see thanks!!!!!

    edit:

    this actionscript:

    speed = 4;
    dot_mc.onEnterFrame = function() {
    var a = Math.atan2(_root._ymouse-this._y, _root._xmouse-this._x);
    var dx = this._x+Math.cos(a)*speed;
    var dy = this._y+Math.sin(a)*speed;
    if (!maze_mc.hitTest(dx, dy, true) && !maze_mc.hitTest(dx-this._width/2, dy-this._height/2, true) && !maze_mc.hitTest(dx+this._width/2, dy+this._height/2, true)) {
    this._x = dx;
    this._y = dy;
    }
    };

    dot.mc is slow when below 5 for a speed and above that its really laggy when it is higher. Can this be fixed or tweaked in anyway?
    Last edited by John M O'Shea; 10-23-2004 at 12:01 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center