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

0 favourites
  • 4 posts
From the Asset Store
Adjusting the game screen for different resolutions (Letterbox scale)
  • 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 .

    What I am doing wrong ??

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • what 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).

  • Thank you guys ...

    Now it's clear

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)