A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: enemy movement

  1. #1
    Junior Member
    Join Date
    Jan 2011
    Location
    BM,Morroco
    Posts
    17

    enemy movement

    hello
    I want to make this movement by code (as3)



    only by code , I mean how to make the mc move only over the green area

    thanks in advence

  2. #2
    Senior Member
    Join Date
    Jul 2008
    Posts
    391
    It looks like it's moving along a zigzag pattern of lines, no curving or collisions at all. All that requires is an array of points and have the object move from one point to the next. But if you want collision that's a whole different story, you'll need to know a whole lot of math (I've never done collisions with curves).

  3. #3
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Why not just use Motion Tween with a Guide Line, to make a smooth motion, instead of complicated math?
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  4. #4
    Senior Member
    Join Date
    Jul 2008
    Posts
    391
    Oh yea...this is why we have more than 1 person helping!

  5. #5
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    @5Five555: sorry, I didn't quite get you (sorry for my lack of comprehension), what do you mean xD? Like, was that sarcasm, negatively referring to me, or?
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  6. #6
    Senior Member
    Join Date
    Jul 2008
    Posts
    391
    Nope, I meant it's a good thing I'm not the only person helping, or he might have gone with my more complex solution compared to your simpler one.

  7. #7
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Oh, good to hear
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  8. #8
    Junior Member
    Join Date
    Jan 2011
    Location
    BM,Morroco
    Posts
    17
    I want the code please

  9. #9
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    As already mentioned by 5Five555, making this with code would be really difficult, and would probably require you to make your own gravity and collision detection codes, so you're better off doing it with animation. If not, then please refer to tutorials such as THIS ONE
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

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