Single sprite with different animations vs multiple sprites

Discussion and feedback on Construct 2

Post » Sun Mar 01, 2015 9:37 pm

My structure is the following:
1 Sprite for the player (invisible, used only for collision) + 1 Sprite for the player's animations
(since the player will have a lot of sprites + skins I will use a different sprite from the other objects)
1 Sprite for the objects in the game and for enemies (invisible, used only for collision) + 1 Sprite for animations
1 Sprite for the level's layout
1 Sprite for the onscreen buttons/gamepad
1 Sprite for HUD and other elements
1 Sprite for the elements in the Main Menu
...etc

While I still use several sprites for the animations, I grouped them and pick them using a variable named "ID".

Just to make sure, draw calls are made every tick, not just only when a sprite changes frame/animation ?
B
47
S
15
G
6
Posts: 497
Reputation: 7,064

Post » Mon Mar 02, 2015 10:03 pm

Depends. In my experience its hassle to choose random sprite, need to use variables. So I just name my sprite animations "name" & 1, so I can switch and call them whenever I want to.

This way you can have several walking animations for different characters etc.
B
6
S
2
Posts: 24
Reputation: 531

Post » Wed Apr 01, 2015 3:23 pm

Really interesting! Thanks for the hints!

One question:

- Is it really necessary to use an empty sprite and "pin" the animations? I mean, You can use the collision poligon in each frame of the animation. This way you avoid using one extra sprite + the "pin" behaviour.

Shouldn´t this improve performance even more?
B
10
S
2
Posts: 69
Reputation: 1,032

Post » Wed Apr 01, 2015 4:03 pm

What I do: If I have an object that will have different looks but same mechanic (like levers, or buttons), I use one sprite with multiple animations. However if the object have a different mechanics, I use seperate objects to make it easier for myself.
B
20
S
8
G
4
Posts: 194
Reputation: 3,553

Post » Wed Apr 06, 2016 7:21 pm

TGeorgeMihai wrote:My structure is the following:
1 Sprite for the player (invisible, used only for collision) + 1 Sprite for the player's animations
(since the player will have a lot of sprites + skins I will use a different sprite from the other objects)
1 Sprite for the objects in the game and for enemies (invisible, used only for collision) + 1 Sprite for animations
1 Sprite for the level's layout
1 Sprite for the onscreen buttons/gamepad
1 Sprite for HUD and other elements
1 Sprite for the elements in the Main Menu
...etc

While I still use several sprites for the animations, I grouped them and pick them using a variable named "ID".

Just to make sure, draw calls are made every tick, not just only when a sprite changes frame/animation ?



Shouldn't you use 'Tiled Background' for level layout?
B
11
S
1
Posts: 6
Reputation: 746

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 2 guests