Help on enemy movement please

This forum is currently in read-only mode.
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hiya, im new to the forums (and pretty new to construct too)

    im using construct classic so i can learn and master it while i wait for the full release of C2.

    right down to the problem, i making a platformer at the moment and in level 3 i want enemies to start appearing, so ive got my little enemies and i need them to move left and right, stopping and turning round before falling off the platforms like a bunch of lemmings or walking into walls like a delirious drunk..

    ive taken out the code that didnt work (from platform school :L)

    so i was wondering if anyone could write me a way that works, i would really appreciate it as ive been racking my brains and scouring the internet trying to find a way with no luck.

    Btw great piece of software, so much better than game maker :)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • ok so 74 views but no answer, i guess i didnt really explain enough, i just want my enemies to have simple left-right movement from 1 side of a platform to the other like the enemies in mario.

  • here is a picture of whats going on

  • The easiest method is going to be to add some dummy sprites at the end of each platform. Then on collision with the dummy, turn the opposite direction. Like:

    -+enemy on collision with dummy

    ->enemy set angle to angle(enemy.x,enemy.y,dummy.x,dummy.y)-180

  • thank you very much newt, im just trying that now, i'll let you know how it goes :)

  • well it half worked, my enemy will turn around if he hits the dummy on the right (so he's now travelling left) but he walks straight through the left one instead of turning back again :S

  • here is the .cap file, the enemies are on layout 6, would you mind taking a look at the events sheet and show me where ive gone wrong please?

    box.com/s/txxyij4rghepk9oyjzdu

  • Couldn't find a layout 6, or where you you were needing the ai, but here is a simplified version of the method.

    platai

  • oh, thats really strange :L sorry about that, thanks alot for the help newt

  • that .cap is simple but unbelievably helpfull, thank you very much

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)