zatyka's Forum Posts

  • To answer your question regarding mirroring, when you mirror a sprite, you're essentially settings it's width to negative. So if you have a sprite with a width of 25, and you set it to mirror, its width is -25. So in your example, your resizing back to un-mirrored dimensions.

  • Did you try comparing the text to see if it does not equal ""?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You need to pick the specific instances of the icon you'd like to destroy. One way would be to set an instance variable on the icons as they're being created in the loop, and when you're ready to destroy one of them, choose the icon with a specific value in its instance variable to destroy.

    However, I think there's a much more efficient way to do it using a global variable for lives, and running a function whenever the number of lives change.

    Demo

    Capx.

    I hope this helps.

  • I'm not exactly sure what you consider simple, but unless you're only going to have an inventory big enough for a couple items, you'll need to get comfortable using Arrays. There are some very helpful tutorials going over the basics of array in the tutorials sections of the site. I'd recommend you check them out.

    Here's an annotated demo. The inventory is stored in an array, so it will be saved between layouts.

    Demo

    Capx

    I hope this helps.

  • I would create a function to show the items in the array, and call it as needed. I'm not at my main computer, so I'll just wing it with the code. I'm assuming you're storing the inventory items in an array that is 4x6x1. If so, it would be something like this:

    On Function "Show Inventory"

          For Each InventoryArray XY

                Create Object IventoryItem

                Set InventoryItem Animation to InventoryArray.CurValue

                Set InventoryItem X position to (Whatever X you want the first inventory item to appear + InventoryArray.curX * InventoryItem.Width)

                Set InventoryItem Y position to (whatever Y you want the first inventory item to appear. + InventoryArray.curY * InventoryItem.Height)

  • Perfect. Thanks everyone!

  • Adding the border to the div around the canvas gives me this.

    Granted, my css/html knowledge is very limited, so I could be adding it to the div incorrectly.

  • I'm not sure if I'm doing something incorrectly, or if this is a bug. I'm guessing the former, so I'm checking here first. When I export a project to an HTML5 website, and change the index.html file in a way that moves the location of the canvas, the mouse doesn't seem to function correctly. Here's an example. The red box is supposed to always be centered on the Mouse. Both links are pulling from the same runtime file:

    Standard index.html

    index.html with a couple page breaks, and a border around the canvas

    In case it helps, I'm exporting using r112, and testing in Firefox. Here's the capx.

    Anyone know what I'm doing wrong, or is this a bug?

  • Thank you very much. That was very helpful.

  • I'm hoping someone can offer me some advice.

    I have a scenario where the main character walks around a room. Within the room are multiple objects belonging to the same family (named FindableItems). The family has an instance variable to determine whether the object is "findable".

    Among the family's "findable" objects within a certain distance, how can I determine which one is nearest to the main character   Right, now it looks something like this

    <img src="http://i.imgur.com/MKC3b.png" border="0" />

    This results in a lot of false positives as it's not respecting the "findable" variable, and distance from the hero, when choosing the nearest object. I'm sure there's a way to do this that I'm not thinking of.