dop2000's Recent Forum Activity

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

  • Try Construct 3

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

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

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

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 257 followers

Connect with dop2000

Trophy Case

  • 8-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
  • x13
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

28/44
How to earn trophies