How do I create a Sprite without adding it to Layout before

0 favourites
  • 3 posts
From the Asset Store
In this template the music plays without looping in your game
  • Hi everybody,

    I'm wondering how I can create a Object/Sprite without adding it to the Layer once before.

    For example:

    I have fruits falling from the top. If a fruit hits the floor the player loses one life.

    How can I setup the fruoit (e.g. add falling behaviour etc) without adding one initial fruit to the layout, which means that it will fall down on game start and costs a life of the player.

    Edit:

    I tried setting up the fruit and removing it from the layout after that. Then it's saved as Sprite with every setup in the project but if the game tries to init such an object the browser shows an error message.

    Thanks.

    Best regards

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Two possibilities:

    1. Just destroy the sprite on Layout Start

    2. Have a separate Layout just for graphics, therefore they are always available to the project.

  • "2. Have a separate Layout just for graphics, therefore they are always available to the project."

    ... You can do that? Why hasn't this been mentioned in every tutorial I've watched? Good to know.

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