dop2000's Recent Forum Activity

  • Or pin your image to invisible draggable sprite.

    Or simple change the collision polygon on your sprite - make it smaller.

  • Physics angle of motion:

    angle(0, 0, Sprite.Physics.VelocityX, Sprite.Physics.VelocityY)

    To compare two angles you can use anglediff() expression.

  • Even if you are using lots of sprites, there are still ways to optimize them.

    First, read these tutorials:

    https://www.construct.net/au/blogs/cons ... memory-796

    https://www.scirra.com/manual/134/performance-tips

    https://www.construct.net/au/blogs/ashl ... -works-917

    Try to make images (in sprites) as small as possible. Don't create big sprites and then scale them down on the layout.

    Don't create sprites with many animations.

    If you only need pine trees on this layout, a sprite containing 20 different animations for all kinds of trees will consume a lot of memory.

    If you have huge layouts with thousands of background sprites, try to build a system where sprites are created as you progress through the level and destroyed when they are no longer needed.

    Or at least disable animations/events/behaviors for sprites that are off-screen.

    Avoid using effects and behaviors on too many sprites.

    Regarding the issue with the TargetScale - you can do something like this:

    Every 1 second:
    Tree compare instance variable TargetScale<1   -> Add 0.1 to TargetScale
                                                   -> Tree set scale to TargetScale[/code:vut6cbur]
    
    Trees that have reached scale 1 will no longer be picked by this event.
  • You didn't provide any information - what behaviors you are using? Is this Physics/Platform game? Are these objects Solid?

    If B should not collide with anything, you can simply disable collisions for this object.

    Otherwise you need to handle collisions with events - create events for different combinations:

    A on collision with C -> do this

    B on collision with C -> do that

    etc.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Your question is about C2, why are you posting in C3 forum?

    You can generate a big random number, save it to local storage and use it as a unique user ID.

  • You do not have permission to view this post

  • It's hard to tell what your are doing wrong without seeing your project.

    Please share your capx file.

  • Why do you need to protect save files like this?

    As a player I would be pissed if I couldn't load my old saves after replacing some hardware on my PC (say, motherboard or HDD).

  • YoHoho

    Of course you can change it for a bigger grid, just need to modify the values throughout the code - for example for 10x10 grid in event #2 change condition to newX<10, in event #4 change the formula to min(9, x+1) etc.

    Did you watch the video from the first comment? This algorithm is used for dungeon generation.

  • If you have three "Open" functions and all three are called at the same time - that's poor project design, not a C2 issue.

    Construct does many things differently from "real" programming languages, but personally I like how flexible functions in C2/C3 are.

  • unixtime can only return current time. So to convert any date/time in the future you need to use some external function or addon.

    Rex's "date" addon can also convert to unix time.

    EDIT:

    Actually, you don't need to use C3 expression and can calculate the remaining number of seconds directly in JS:

    Set difference to: Browser.ExecJS("(new Date('" & textDate & "').getTime() - new Date().getTime()) / 1000")

  • JS code converts date (textDate) into Unix Epoch Time - number of seconds that have elapsed since January 1, 1970

    "/1000" because that JS function returns milliseconds, and we need seconds.

    unixtime is a C3 expression, it returns current system time in unix format, also in milliseconds.

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