Combining Sprites

Discuss game development design and post your game ideas

Post » Fri Nov 11, 2016 6:11 am

I need to make a space ship composed of multiple parts that work together. Is it possible to make several sprites that are attached and work together, rather than having the entire ship represented by a single sprite. I also need each part of the ship to have it's own health. I eventually want to make it so that multiple players can cooperate by controlling different parts of the ship.
B
5
Posts: 8
Reputation: 241

Post » Fri Nov 11, 2016 8:47 am

One sprite will be the 'base', the others attach to it.
Use imagepoints on the 'base' sprite to mark where the parts sprite will be attached.
To attach, use the pin behavior, or a simple 'set position of part sprite to imagepoint on base sprite' every tick.
For easy creation and simple picking, bring base sprite and sprite parts in a container.
Each instance of a sprite has individual instance variables.
B
33
S
18
G
27
Posts: 2,431
Reputation: 20,326

Post » Fri Nov 11, 2016 8:53 am

You can use the pin function to do this. You have the hull of your ship then you pin all the other parts on it.
construct 2 manual
youtube video about pinning with construct 2

You pin different objects to your ship hull, each object can have different HP.

For the multiplayer part I don't know but I think that it should work.

(Edit I was ninjad but there are links if you need.)
B
12
S
7
G
4
Posts: 114
Reputation: 3,067

Post » Fri Nov 11, 2016 7:47 pm

I used the "set position to object image point", but there's a problem. The ship part connects at its origin point. Do I need to move the origin point, or can I make it attach at another point. I'll just move the origin point for now.

... I got the parts to attach to the right points, but now they don't move properly. When the main body of the ship turns, the other parts maintain their original orientation, rather than turning with the body.
B
5
Posts: 8
Reputation: 241


Return to Game Development, Design & Ideas

Who is online

Users browsing this forum: No registered users and 0 guests