How do I load different image only on new instances ??

Get help using Construct 2

Post » Sun Aug 03, 2014 10:18 am

Hi all,

I have a little problem while trying to develop a simple space shooter game.
What I am trying to do is to change enemy images when I reach by example a score of 600 point

I create a function called CreateEnemy where Enemy is a transparent sprite, and as parameter I get the url of image I want to load.

Anyway when I reach 600 point all the instances on the screen change their image :cry: :cry: :cry: :cry: .

What I am doing wrong ??
You do not have the required permissions to view the files attached to this post.
B
3
Posts: 2
Reputation: 179

Post » Sun Aug 03, 2014 9:10 pm

You can't have more than one image for an object, that's why all instances get the same image.
You can set animation speed to 0 than load an image to frame 0 and a different one to frame 1 and then choose what frame to show on what instance.

It seems like you're using only one frame anyways, so animation speed has no effect.
Image
B
71
S
28
G
12
Posts: 515
Reputation: 12,284

Post » Sun Aug 03, 2014 9:54 pm

what @Lof means, is you can't have more than one image file loaded for an object. but you can have many images for an object by using animation frames. You probably won't want to load them during runtime, though. Instead you would have a different animation frame for each image you needed. so when the score reached 600, you would just change what frame the object was showing (and you would probably want your animation speed set to 0 for this because as you started adding more frames, it would play through them instead of just showing the one you wanted).
B
86
S
43
G
71
Posts: 601
Reputation: 43,619

Post » Sun Aug 03, 2014 11:29 pm

Thank you guys ...

Now it's clear :D
B
3
Posts: 2
Reputation: 179


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest