brunopalermo's Forum Posts

  • Hey imothep85!

    Here's an adjusted capx. I added a loader, so the iFrame only shows after its content is fully loaded.

    https://www.dropbox.com/s/cb0axyo685ddv ... .capx?dl=1

    Also, I checked the Le Soir site and it has, indeed, a http header called X-Frame-Options set to "sameorigin", which keeps it from being loaded in a frame that is not on the same site.

    Note: do not add events to the layAssets layout. It's a eventless layout that has the purpose of storing stuff that will be created dynamically, since Construct 2 needs at least one instance to exist so it can load an object. Think of it as an asset repository.

    Hope this helps. Cheers!

  • As dop2000 mentioned, just use gravity 0.

    Check this capx for an updated example...

    https://www.dropbox.com/s/sr5ry6c7l1vmg ... 2.capx?dl1

    Click anywhere to apply an impulse from that point towards every object.

    Cheers!

  • Translation:

    -Help me hack this game.

    Posts: 1

    Reputation: 127

  • You should use a family instance variable, instead of an object one. This way you could just do the following:

    Pick FamilyGrains by UID | Set TextObject.Text to FAmilyGrains.V_Name
    [/code:2wfqulz9]
  • My bet is that the problem is with some sites, not your events, but... Maybe both things are contributing to the problem. i can't say without checking your capx. Good luck!

  • Hi imothep85!

    Well... That doesn't make any sense. I checked the DH.be site and it opens on both situations, if you put it as default or when you click a button, the other one Le Soir, doesn't open in any of those situations. So, I can only assume that someting at Le Soir is keeping you from opening it inside an iFrame.

    https://www.dropbox.com/s/0ayn1szj5nzc8 ... .capx?dl=1

    Check this example. I have a button for LeSoir and I'm trying to open it by default. None of those work. All other sites, including DH.be work fine. Note, also, that TED site will blow the iFrame and open itself out of the construct window and in the main browser window.

    Cheers.

  • If you set immovable to yes they will be immovable, no matter how much impulse you apply. In order to keep them from falling you should create a ground or something, which must also have the Physics behavior...

    https://www.dropbox.com/s/iat0s4bzf9fek ... .capx?dl=1

    In this capx I apply the same impulse at the same angle to both objects everytime you click anywhere. See how they behave differently. Also, note that you don't have to add the Solid behavior to Physic objects. They already recognize one another as solids...

  • Note that some sites won't open in iFrames. Others will detect the iFrame and refresh out of it. So. I'd suggest you check the sites you want to open in the iframe outside of your construct app, before trying to solve the problem on construct. A simples way to do that is by accesing the iframe TryIt! tool at w3schools (https://www.w3schools.com/tags/tryit.as ... tml_iframe), changing the url there and hitting "Run". If it doesn't open there, it wo'nt open on your construct app. For instance, I just checked "http://www.lesoir.be/" and it doesn't open in iframes...

    Hope this helps. Cheers!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • when it aim to object (ex: Player) i want to appear the game over screen what i do

    I don't get what you're trying to do... Could elaborate on that?

    Cheers!

  • What is the behavior you're trying to achieve here, exactly?

  • I usually prefer using a timer for the gun/player object. It's better to config and evolve (if want to evolve the weapon and make the burst longer or faster).

    Here's an example I made using the Ghost Shooter template.

    https://www.dropbox.com/s/xulbpzmkkgc0r ... .capx?dl=1

    Use asdw or the arrows to move, mouse to aim, shoot with left click and burst with right click.

    Hope this helps. Cheers!

  • Hey Christmas,

    You'll probably use the Browser>Execute Javascript action, as you guessed. The thing is, if you don't know Javascript, someone will have to write some code for you. Anyway, talk to your employer. Chances are they already have javascript functions to deal with those actions, so, you'd just have to call those functions using the Browser>Execute Javascript action.

    hope this helps. Cheers!

  • Thanks for replying Bruno

    Based on your answer, this is what I've managed so far:

    I have a couple of questions.

    • Create productBox at columnX, loopindex * (productBox.Height + boxSpacer) - I'm guessing productBox is am image, is this correct? Also, how do I add the actions at columnX, loopindex * (productBox.Height + boxSpacer)
    • Load imagePlaceholder from array.At(4) - Do I just add the object name of each image in column 4 of the Array?
    • Spawn XXX at imagepoint(XXX) - how do I use Spawn? It's not available as an action.
    • What is an imagepoint and how do I create one?

    Thanks for your help on this.

    First of all, your Repeat loop should be nested inside the Ajax>On completed event. Now to your doubts:

    1. Yeah, it's a bogus name for a Sprite object that would be the base of your list item. When you create an object it will ask you for the X, the Y and the layer at which it will be created. In my example, I calculate the Y based on the height of the box and the spacing between boxes.

    2. In my example I'm loading an external image, so in that case you would add the relative or absolute url of the image. Adding all images as individual sprites is very cumbersome and I'd strongly recommend you don't do that. You may use the approach I mentioned and create one sprite and storing product images as its frames. In that case, the image column would just tell the frame to go to. Also, notice that array indexes start at 0, so 4 is, actually, the fifth column.

    3. "Spawn another object" is an object action, that is, you'll got to "productBox>Spawn another object" (or whatever name you use for your product box).

    4. Spawn requires the new object to be created at an imagePoint. Imagepoints are like "hotspots" you can add to a Sprite object. All Sprite objects have one imagepoint (index 0) by default, which is their origin. You can add more imagepoints by opening the Sprite in edit mode and picking the tool that looks like an aim or crosshairs. When you pick the tool a window will show a list of all imagepoints for that image. You can add new ones using that window.

    Hope this helps. Cheers!

  • Your guess there is right. Just use AJAX, load the array from LastData and run a loop.

    Something like:

    System | Repeat array.Width times |  Create productBox at columnX, loopindex * (productBox.Height + boxSpacer)
                                      | Load imagePlaceholder from array.At(4)
                                      | Set productName.Text to array.At(1)
                                      | Set cost.Text to array.At(0)
                                      | Set shortDesc.Text to array.At(2)
    
    productBox | On Created | Spawn productName at imagepoint(0)
                            | Spawn cost at imagepoint(1)
                            | Spawn shortDesc at imagepoint(2)
                            | Spawn imagePlaceholder at imagepoint(3)
                            | Spawn selectButton at imagepoint(4)
    [/code:1gkhwgxy]
    
    Note you must create all those imagepoints in the productBox sprite and position the at the positions the other graphic elements should be spawned. You could use the container approach, but I prefer spawning stuff at the positions rather than creating everything and then positioning everything relative to the productBox.
    
    Also, if you have few products and will never add more, you may have all images as frames of one sprite and just set the frame accordingly. But it would be a terrible idea if this product list must be scalable.