Coding a Final Boss, Help Required [ESSENTIALLY SOLVED]

For questions about using Classic.

Post » Sat May 07, 2011 5:53 am

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.

[size=150:28rfy31j]WHAT NEED HELP WITH:[/size:28rfy31j]

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. :shock:



[size=150:28rfy31j]IDEAS ABOUT ENEMY ATTACK:[/size:28rfy31j]
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!
Check out my VGM on my soundcloud page!
Video-Game Music: E.C.2151
B
7
S
2
G
2
Posts: 193
Reputation: 1,561

Post » Sat May 07, 2011 2:42 pm

yup, that's pretty much the basic way to code a state machine type enemy.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Sat May 07, 2011 9:49 pm

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...
Check out my VGM on my soundcloud page!
Video-Game Music: E.C.2151
B
7
S
2
G
2
Posts: 193
Reputation: 1,561

Post » Sun May 08, 2011 11:59 pm

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.
B
8
S
2
G
6
Posts: 44
Reputation: 3,007

Post » Wed May 11, 2011 3:27 am

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[/quote:1y51gran]
Check out my VGM on my soundcloud page!
Video-Game Music: E.C.2151
B
7
S
2
G
2
Posts: 193
Reputation: 1,561

Post » Wed May 11, 2011 5:11 am

Try custom movement "restrain distance from object" when distance greater.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Wed May 11, 2011 6:23 am

That worked like a charm!

Everything is moving swell now. Thanks a whole bunch, newt!
Check out my VGM on my soundcloud page!
Video-Game Music: E.C.2151
B
7
S
2
G
2
Posts: 193
Reputation: 1,561


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests