How do I draw lives

Get help using Construct 2

Post » Wed Jul 16, 2014 12:25 pm

Hey,

I have been stuck on this for a while now. I was wondering how to draw lives? Because in GameMaker I can do it with ease in a for loop but the same method doesn't work in Construct 2.

I basically want to take a single sprite and draw it as many times as the value of a variable. But with a single command. so it can loop.

Thank you :D
B
9
S
1
Posts: 48
Reputation: 675

Post » Wed Jul 16, 2014 1:32 pm

Something like this?

livesdisplay.capx
You do not have the required permissions to view the files attached to this post.
B
46
S
23
G
7
Posts: 459
Reputation: 6,763

Post » Wed Jul 16, 2014 1:39 pm

I personally like to use the sprite as a tiled background and adjust the width according to the variable.

Here's an example .capx:

lifemeter.capx
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
20
S
6
G
2
Posts: 623
Reputation: 3,498

Post » Wed Jul 16, 2014 2:16 pm

Would using a tiled backround and setting it's width to variable*(width of one life) work for you?

Doing it with seperate sprites would be possible as well ofcourse..

Both in one capx:
You do not have the required permissions to view the files attached to this post.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Jul 16, 2014 4:37 pm

Wow! Thank you all of you! I never knew the possibilities were so broad! :D I have saved each to put them into consideration :) I am really grateful! Thank you! :D

In your opinion which would work the best for mobile games without performance loss? :P
B
9
S
1
Posts: 48
Reputation: 675

Post » Wed Jul 16, 2014 4:39 pm

I'm not sure about performance, but I really find the tiledbackground method simpler... :) @Minor and @LittleStain would probably know more about performance than me, since they're more experienced...
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
20
S
6
G
2
Posts: 623
Reputation: 3,498

Post » Wed Jul 16, 2014 4:45 pm

Thanks for that :P I agree haha lets see what others have to say then too :D Thank you brunopalermo :)
B
9
S
1
Posts: 48
Reputation: 675

Post » Wed Jul 16, 2014 4:50 pm

I would always go for the tiled background method if acceptable.
It's just the easiest and the most effective when it comes to memory use..
One of the disadvantages of the tiled background method could be not being able to use animations in it..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Jul 16, 2014 4:52 pm

That's great! :D I don't need animations for it so its fine :) Thank you all! :D
B
9
S
1
Posts: 48
Reputation: 675


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests