dop2000's Recent Forum Activity

  • So when W is pressed, you call function "add" 3 times. In "add" function you call "update", so it goes add->update->add->update->add->update. These 6 function calls are performed one after another, but all in one tick.

    Inside the "update" function you check if Item with ID exists, if not, you create it. Object instance is not created immediately, you need to wait till the next tick before you can pick it by its instance variable. That's why your code works differently when you add "Wait 0" before function calls - it allows time for Item to be created.

    It's possible to fix this without "Wait 0" - for example, you can set some flag in the array when Item is created, but I don't really understand your code, so can't help with this.

    Also, if you need to see the order in which events are executed, add Browser Log action to your functions. Press F12, and you will see log messages in console. It's a powerful debugging method, you can output variable values, array contents, function parameters etc. and see how they are changing.

  • In events 4 & 5 you are picking Player instance. You need to change them to pick Enemy instance. So it needs to be "Enemy compare X..."

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Your file is named "This thing YYY-3.capx.zip"

    You need to remove ".zip" from the end. To do this, you need to see file extensions in Windows. But, as I said in my previous comment, even if you do this, you will still not be able to open this file in Construct 2, because the project is corrupted.

    If you want to try fixing it, you need to rename the file to "This thing YYY-3.zip", unzip it into an empty folder and then manually edit caproj and all xml files.

  • I can't open your project as it uses some effect which I don't have. But I'm almost certain the problem is with the collision polygons. Ideally the Origin point and collision polygon should be identical for all frames in all animations of character sprite.

    A very common approach is to use an invisible sprite (simple box) with Platform behavior for controlling the character. And pin your character sprite with all animations to that sprite. Then you will not have these issues.

  • You can save and restore progress with Local Storage, either as a single variable, or as an array/dictionary.

    dropbox.com/s/szxb22rfzfcv9if/localStorage2.capx

    dropbox.com/s/f2d7lc8o4zajgeg/LocalStorageDemo.capx

  • The easiest way is to spawn a sprite with Fade out behavior at Player position on every tick.

  • It's not as easy as it seems.. Normally you add delays in loops using loopindex expression, but "JSON for each property" loop doesn't support loopindex, and JSON.CurrentKey/CurrentValue are not available after Wait.

    So the only solution I could think of is to load all keys and values into a temporary array and then do this:

  • You can compare each line in a loop using tokenat expression. There may be an easier way with regex, but I don't know it.

  • Could you share your project file? I am still quite sure that these conditions are useless and not required here, but maybe I can find the real reason why the code doesn't work without them.

  • Are you talking about the last formula? It should work with any number of frames in the animation.

    .

    I am not very good at explaining..

    (((mouse.X-startX)/8)+(Sprite4.AnimationFrameCount*10)+startFrame)%Sprite4.AnimationFrameCount

    Here "8" means sensitivity - frame will change every 8 pixels.

    %Sprite4.AnimationFrameCount is the remainder after division. For example, 50%36 will give you frame number 14 in animation with 36 frames.

    (Sprite4.AnimationFrameCount*10) - this part of the formula is needed to prevent the value in brackets to go into negative numbers (when you swipe to the left). It basically just adds 360. For example:

    (10+360)%36=10

    (-10+360)%36=26

  • Keyboard On C pressed
    System For each Door
    	Door Solid is enabled -> Door Solid set disabled
    	Else -> Door Solid set enabled
    
  • tokencount(text, newline)-1

    You can wrap text in trim() expression to remove any line breaks at the end:

    tokencount(trim(text), newline)-1

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