LittleStain's Forum Posts

  • 600 separate button objects?

    Why not 600 instances of 1 button object?

    All you'd have to do is give them all the variable and on start of layout set the text to the variable.

    Then on button clicked check the variable to see the function..

    But I might understand it the wrong way..

  • This is the best I can come up with for now..

    Not perfect, but pretty nice, if I may say so myself..

    https://dl.dropboxusercontent.com/u/485 ... ution.capx

  • It seems like button.text is not available.

    You could ofcourse give the button an instance variable and set the text of the button to the instant-variable so you could later use button.variable to get the button-text.

  • Here's one without shaking:

    https://dl.dropboxusercontent.com/u/485 ... kes-1.capx

    You're biggest problem is when the "tank" changes direction it does so almost instantaniously, so the "top" has no time to adjust (rotate towards) a possible angle.

    you might want to add an action on direction changed (or key-press to make direction change) setting the angle of the top.

  • ok.. A few questions..

    Why is there a sprite3, sprite4 and sprite5, when they are exactly the same object as sprite?

    Why not use instances?

    Why is there a drag and drop behaviour on both the sprites and the family all the sprites are in?

  • Using local storage is the easiest way and should work something like this:

    local storage set Item key = "PlayerCoins" value = (the name of your GlobalVariable)

    on start of layout - local storage get Item "Playercoins"

    on item get "Playercoins" - set GlobalVariable = int(localstorage.itemvalue)

  • Offcourse it would be much nicer to check the distance between the two objects and if close enough have them move to the destination.

    The same way you could check collisions and overlap with different objects and if (for example) the triangle fits inside the square have it go to the fitting position based on distance and overlap, or not..

  • So I guess you allready got this far?

    https://dl.dropboxusercontent.com/u/485 ... tance.capx

    Very dirty method to get the first part working, by the way..

  • Most probably the sprites have a behaviour attached that sets the angle of the sprite, based on the angle of movement,

    but without your capx we can only guess..

  • It all depends on how you'd like it to work..

    Because of the many possibilities you should think of a way to accomodate them all..

    I guess overlapping is the first thing you'd want to check

    If the square (for example) is overlapped by the triangle, and the triangle fits in the square, you could add conditions for it to go (or not go) to the place it fits..

  • https://dl.dropboxusercontent.com/u/485 ... layer.capx

    The coordinates touch.x,touch.y are the project coordinates.

    Luckily the touch object has the possibility to add a layer number behind the x and y

    so touch.x(2) is the position of touch on layer 2 (your hud)

  • From the manual:

    Textbox

    The Textbox object creates a text field which the user can type text in to.

    Form controls are actual HTML elements floating above the game canvas in the HTML page. Therefore, nothing can be displayed on top of a form control, apart from other form controls.

  • pinball on collision with bouncer things in a pinball machine

    pinball apply impulse at angle(pinball.x,pinball.y,bouncer things in a pinball machine.x,bouncer things in a pinball machine.y)

  • > Although this answer is so simple, it almost can't be the answer you are looking for:

    >

    > in the request action you can set a "tag"

    >

    > in the on completed action you can set that same "tag"..

    >

    > so in the ajax on completed with that specific "tag" - you can set the actions for what to do with the data associated with that specific ajax request..

    >

    Yeah but it gets more complicated in my case

    I want a text to change to the file requested with AJAX, so if I request several files (with texts in it) it will get confused with what I mean with "GetLast" :/

    What's more complicated?

    Ajax on completed "tag" - set text to ajax.lastdata

    Ajax on completed "othertag" - set other text to ajax.lastdata

    from the manual:

    LastData

    The contents of the last response. This is set in the On completed trigger. If used in a different event, it contains the response of the last completed request.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You would only need to use the same texture 2x..

    so the texture would only have to be loaded into memory once

    (If you use the invert effect I talked about above)

    By the way, what's the benefit of using 4k textures?