Adding Sprite on the fly

0 favourites
  • 5 posts
From the Asset Store
Minimal Sprite Font with Stroke for Pixel Art games.
  • HI all,

    Can you give me help about adding sprinte on the fly:

    exemple adding :

    adding a picture after having some value in score{adding heard to explain that have a new live in my game.}.

  • to be more clear adding sprite means :

    if my variable lives = 3 I will print   <img src="smileys/smiley10.gif" border="0" align="middle" />    <img src="smileys/smiley10.gif" border="0" align="middle" />    <img src="smileys/smiley10.gif" border="0" align="middle" />

    if lives = 2 I will print    <img src="smileys/smiley10.gif" border="0" align="middle" />    <img src="smileys/smiley10.gif" border="0" align="middle" />

    ===>sprite creation in dynamic it's related to lives variable.

    thanks of help

  • Seems like what you'll want to do is a for loop using your Lives variable. You can create a new sprite and position it next to the last one within your loop.

    You might want to do that in a separate event sheet, where you can first delete all the existing sprites, then create new ones within the loop. You can then call that event sheet whenever a change is made.

    There are other ways, that's just one.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thinks I have resolved this problem by using tiled background plugin and modify his width on evey tick system set width to lives * width of my backgroud element <img src="smileys/smiley27.gif" border="0" align="middle" />

  • Good idea. <img src="smileys/smiley20.gif" border="0" align="middle" />

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