How do I make multi-tier (combined) objects

Get help using Construct 2

Post » Fri Dec 19, 2014 10:38 am

Hello, all. I have been using containers for simple tasks, but the question is - can they successfully be used for more complex combined objects, let's say, something like this (a classis shmup example):
Image
We have our large base image and multiple objects of the same type attached to it, which function independently:
Image
And then have the ability to independently destroy those objects too:
Image

What would be the best way to achieve this? And, preferably, with multiple "depths" i.e. A huge plane with several turrets in wings where the turrets can be shot off, then the wing itself, but the rest keeps going.
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Fri Dec 19, 2014 12:21 pm

You couls use the Pin behavior. I believe its more flexible for this kind of stuff.

https://www.scirra.com/manual/99/pin
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
16
S
4
G
1
Posts: 408
Reputation: 2,297

Post » Fri Dec 19, 2014 12:56 pm

That sounds like exactly what I need! It also sounds like that only works at runtime so larger objects would need to be fully designed, then image points placed or coordinates put down and then the sub-objects added.

Still, it has the most important functionality. Thanks for the tip!
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Fri Dec 19, 2014 1:59 pm

Just did some testing, will have to see how it pans out with multiple objects, but so far so good:

Image

Thanks again @brunopalermo !
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Fri Dec 19, 2014 2:14 pm

Yes... This runtime limitation sucks, but you may use a function to create the objects and attach the parts, like in the example below:

creating-enemies-example.capx


Sorry about the sprites, I just draw some stuff quickly in Construct itself. :p

Nice sprites, by the way... Did you made those yourself?
You do not have the required permissions to view the files attached to this post.
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
16
S
4
G
1
Posts: 408
Reputation: 2,297

Post » Fri Dec 19, 2014 2:29 pm

Awesome example, "loopindex" is going to help me A LOT.

Was planning to make dummy objects on a layout that spawn enemies in different ways - this function example is great, because I can make the dummy object call a function when it enters screen (or close to it) and give its private variables as function variables.

Why do you "floor" the random angle, btw? Just so it isn't a float?

Nice sprites, by the way... Did you made those yourself?

Yup, everything is self-made there.
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Fri Dec 19, 2014 3:01 pm

Yep. I was using the debug text object to check the angles and the floats were too long to show, it was a mess. :) floor is totally optional here. By the way, I guess these angles would not be random at all. You'll probably point them towards your player or something like that. :) I used a random value just for the example.

Regarding the sprites, great work. I, myself, am just a game designer, no artist, so I can't make this kind of stuff and I depend on artists to get my assets done. :)

Glad to help. Let me know if you need anything else.
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
16
S
4
G
1
Posts: 408
Reputation: 2,297

Post » Fri Dec 19, 2014 3:17 pm

Glad to help. Let me know if you need anything else.

Now that's service! Seriously, though, if I ever actually get further with the project, there are many things I suck at (like anything net-related (ads, etc), optimizations, etc). Might be something to cooperate on and split the rewards (hohoho).
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646


Return to How do I....?

Who is online

Users browsing this forum: odiusfly and 28 guests