Coding a Final Boss, Help Required [ESSENTIALLY SOLVED]

This forum is currently in read-only mode.
From the Asset Store
5 levels with simple coding Source-code (.c3p) + HTML5 Exported
  • Hello everyone, I'm proud to announce that I am roughly 80% done with my first Construct game! This topic covers roughly the final 20%. This game is by design, supposed to be pretty simple, so I don't want anything too fancy. However, for getting to the end of the game, I decided to give players a treat in the form of a big last boss!

    The game is kinda like a shmup, except your ship can't shoot anything. It can dodge though, and that's what you need to do for the boss!

    Any and all help will be appreciated, and when this is all done I'll make sure my credits have a nice big SPECIAL THANKS TO SO-N-SO(s) ON SCIRRA CONSTRUCT FORUMS and all that.

    Anyhoo, here's the .CAP

    http://www.mediafire.com/?x8u5y5az9ulzjtv

    The whole deal is in the Layout L5, and the event sheet GranGola.

    I have not animated the boss yet, or put in attack patterns etc., because i want to get a basic movement down.

    WHAT NEED HELP WITH:

    The boss has a variable which will determine when he starts moving, "GO"

    If "Go" is equal to 1, this is what I would want to happen:

    -I'd like to have the boss kind of float a certain distance behind the player, up and down. Nothing jerky or unnatural, but just kind of floating in place

    -I'd like to have it so if the player moves forward, the boss moves ahead with the player

    -If the player moves backwards, towards the boss, the boss will stay still, "waiting" for the player

    I don't suspect this is all that hard to do, with a little tweaking with Custom Movement, but since I don't know where to start using that, I thought I would ask.

    IDEAS ABOUT ENEMY ATTACK:

    Does this sound right?

    I'd want the boss to shoot a certain pattern of bullets at the player every certain interval-

    I'd set the private variable, say, "Attack1" to 5000, and subtract one every millisecond.

    -at every certain interval (say, 4500, 3000, etc), have the boss spawn a certain number of bullets from certain spawn points, and differing angles

    -when, say, "Attack1" reaches 0, I either go to "Attack2" or just repeat Attack1, I don't know yet.

    Does that sound like a good way to go about doing a somewhat regularly-patterned... attack pattern?

    Thank you all for the help!

  • yup, that's pretty much the basic way to code a state machine type enemy.

  • Excellent, I thought so (and I'm glad I didn't need to go about making another topic "HEY GUYZ HOW DO I DO X?").

    Now I just need to figure out this movement thingy. I guess I can glean stuff from how those Cooper things move from the Platform School tutorial...

  • To get the boss to float behind the player in a regular, smooth motion, you'll need to use the Sine behavior, which more or less does precisely that by default. You can play around with the parameters to get exactly the right kind of movement, but it might just work right out of the box.

    This is only the vertical movement, though; for horizontal motion, I think you can give the boss a CustomMovement behavior and then set the boss' horizontal speed to

    max(Lancer[8Direction].VectorX, 0).

    I hope this helps.

  • Thanks for the great suggestions, TheBen. The Sine Behavior worked like a charm; I had never even considered using it before (and I had always meant to test it out.

    I am still having trouble getting the boss to follow the player in the way i signified.

    I did try out your suggestion, but he just kinda floated there, not doing anything.

    To wit, for anyone who wants to jump in, this is what I'd like the boss to do:

    [quote:1y51gran]

    -I'd like to have it so if the player moves forward, the boss moves ahead with the player

    -If the player moves backwards, towards the boss, the boss will stay still, "waiting" for the player

  • Try custom movement "restrain distance from object" when distance greater.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That worked like a charm!

    Everything is moving swell now. Thanks a whole bunch, newt!

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