dop2000's Recent Forum Activity

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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.

  • Add two variables - previousX and previousY.

    On every tick check if Touch.X=previousX and Touch.Y=previousY. If not, this means that the finger has moved. After that save new touch position into these variables.

  • Try this:

    If you have lots of waterfalls on your layout, add "Is on screen" condition to event #4.

  • As far as I know, Save/Load system works independently from the Local Storage. When you save or load the game, the contents of Local Storage is not changed.

    See this demo:

    dropbox.com/s/6fmdstyyke9wa9g/TimeAwayL-2Timers.capx

    You can start "Upgrade 2" timer, wait a few seconds, click save, close the window, open it again, click load - the timer will still continue running.

  • kriand, yep, I noticed the same.

    "System compare variable a=1 OR Object compare instance variable b=1" doesn't work. Definitely a bug.

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 279 followers

Connect with dop2000

Trophy Case

  • 10-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x14
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

30/44
How to earn trophies