how to make appear in the game only those obj whi

0 favourites
From the Asset Store
five golem elements Sprites Sheet.Best for enemy or villain game characters.
  • how to make, appear in the game only those objects which you have chosen in inventory

  • maybe you should explain more... i can't understand what you want to ask. maybe post your capx here.

  • oh sorry it is not him

  • If you mean that only inventory objects should be visible, maybe something like this:

    Event:

    mySprite->Is boolean instance variable set (isInventory)

       Action: mySprite->Set visibility (Visible)

    Event:

    mySprite->(NOT)Is boolean instance variable set (isInventory)

       Action: mySprite->Set visibility (Invisible)

    If you mean to highlight the Inventory objects (that perhaps you can move around, like in Electric Box 2 (space key) or Chessnut (Flashlight function) ), that's a bit more complicated, I can show you how I did it if that's what you mean, just let me know, write Geo in your reply here and I'll post a simple capx.

  • thanks,i will try right now

  • See this. It's a inventory-kind-of i made.

    I think is a lot similar on what you need.

  • Well, similar to what I want, right now, try to do this

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can change a little bit, I do not fully understand?

  • I don't understand what do you need... try to explain it better.

    So anyone can help you ^^

    However the capx i posted is quite simple.

    Look at the InventorySheet.

    It just set a global var on mouse events:

    • to 1 if the object it's selected (with left click) in inventory layout. (It also change the animation to "Selected" to show the sprite orange)
    • to 0 if the object it's not selected (with right click) in invetory layout. (It also change the object animation to "Default" to show the sprite green)

    On start of game layout, gameSheet checks the global var: if it's 0 it destroy the sprite, else it just modify it's position to what you want.

    Going back to invetory layout, InventorySheet checks the global var: if it's 0 it set the animation "Default" (i.e. not selected - green), else it set the animation "Selected" (i.e. selected - orange).

  • okey,http://www.youtube.com/watch?v=GV9LGHfGzN0

    it will be like this,i want ,what caps did you choose in the inventory so you have to play

  • youtube.com/watch

    like this game,watch 0:35

  • Yep.

    Just use two layout and two related sheet.

    The first is the game, which sheet istances the object or not, checking a global var value

    (system -> global var = 0 : object -> set visible or set position)

    (system -> global var = 1: object -> set invisible or destroy or set postion(xOutsideLayout,yOutsideLayout).

    The second is the inventory, which set the global var to 1 if you want to set the object visible or to 0 if you want to set the object invisible.

    It works as the capx i post to you. Download it and modify it as you prefer (touch inputs for example).

  • okey,I'll try to do

  • I really hinder the animation, they can be removed?

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