dop2000's Forum Posts

  • Bump!

  • The workaround is to not use any Form Control objects. There are lots of issues with them.

    You can make your own custom text input box:

    scirra.com/tutorials/739/your-own-textbox

  • What does "origin name" mean? If you want to set item to player position, do this:

    Item set position to (Player.X, Player.Y)

    Make sure that items and player sprites are on the same layer, or on layers with the same parallax.

  • Sprite instances should be on this layout to be able to pick them. It's not possible to pick something from another layout.

    Just copy/paste 5 copies (instances) of Items_common sprite, set correct animations and move them off-screen.

  • Maybe I don't understand your issue, or you don't understand what I'm trying to say... Check out this demo (you should be able to open it in C3):

    dropbox.com/s/209see2urs7zd59/PickRandomItem.capx

  • Just add all items to the layout (outside of visible area) and pick one random instance. This is the easiest solution. See my previous comment.

    .

    I told you many times, arrays and dictionaries are not that complicated. You just need to start using them. It's up to you of course, but if you choose to do everything with global variables, you'll spend ten times more time and will end up with messy and unmanageable code.

  • You can make a While loop to repeat random if it chooses a wrong item, but this is not a great solution. If you have 20 items and 20 variables, this event will be huge!!!

    .

    One way to do this is to keep all these item sprites on the layout (you can move them outside of the visible area). Then use "System pick random instance" event to pick a random item. You can destroy items after they are found or add an instance variable "isFound" to this sprite and do something like this:

    Item isFound=0
    System pick random instance of Item 
     -> Item set isFound=1
     -> Item set position to (mouse.X, mouse.Y)
    

    Another good solution would be using an array or dictionary with all items and remove items that have been found from it. I know that you are trying to avoid using arrays and dictionaries, but I have no idea why :)

  • I once did a demo on terrain flooding, this is somewhat similar. Here is what I came up with:

    dropbox.com/s/yd0p2klipw3mccn/DungeonWallMarkers.capx

    This is probably not the best example and it needs to be optimized. I'm using Water tilemap to visualize "flooding" the dungeon and detect walls, you can use an array instead, it will likely work faster. Also, maybe call the function recursively for each neighboring cell, instead of looping through the entire array many times.

  • If you want to save everything and allow players to save mid-level, use "System -> Save/Load" events.

    If you only want to save a few values - like the number of completed levels, number of lives left, score - use Local Storage. (former Web Storage)

    There are lots of tutorials you can check:

    scirra.com/tutorials/all

  • Not sure I understand your issue.. You can add two instance variables to the Camera object - "targetX" and "targetY". Add this event:

    On every tick: Camera set position to lerp(self.x, self.y, self.targetX, self.targetY, dt*4)

    When varA=varB, set new values to targetX and targetY. And the camera will move automatically to the new position.

    .

    You can also move the camera with LiteTween addon and make some cool easing effects.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The variables could be global, or local static, or instance - doesn't really matter.

    Initial values could be 0. If you want to decrease the bar only when the finger is moving (not on initial touch), then you need to add another event "On touch start -> set previousX to Touch.X, set previousY to Touch.Y"

  • Add AJAX object to your project.

    Use "AJAX Post to URL" action, and then "AJAX on completed" event to check for response.

  • This is a common trick which allows to refer to two instances of the same object in one event.

    Event #6 picks one block instance with specific UID. Event #7 checks if that instance is falling.

    Now you need to find if there are any other instances of block overlapping your picked block, but you can't do that because block inside this event refers to only one instance with that UID.

    So the trick is to use the family. Family acts like a different object, so you can pick different family instances in the same event.