dop2000's Forum Posts

  • ChatGPT explains it better than I could ever do :)

    Explanation:

    LayerToLayerY(...)

    Converts the Y coordinate of the OnscreenMouse sprite from its current layer to the coordinate system of the SmallScreen layer. This gives you the mouse's vertical position as if it were on the SmallScreen layer.

    unlerp(SmallScreen.BBoxTop, SmallScreen.BBoxBottom, <converted Y>)

    Calculates how far vertically the converted mouse Y-position is within the bounds of the SmallScreen sprite.

    If the mouse is at the top of the sprite, this returns ~0.

    If it's at the bottom, this returns ~1.

    If it's halfway down, this returns ~0.5.

    So the result is a normalized vertical position from 0 (top) to 1 (bottom), relative to SmallScreen.

    lerp(SmallScreen2.BBoxRight, SmallScreen2.BBoxLeft, <normalized Y>)

    Now this takes that normalized vertical position and maps it horizontally within the SmallScreen2 sprite — specifically, from its right edge (0) to its left edge (1).

    This is effectively flipping the Y-position into an X-position, which may be used for something like a sideways scrolling effect, or rotating the screen logic 90 degrees.

    Summary in Plain English:

    This expression finds how far down the mouse is on the SmallScreen sprite (top to bottom as 0 to 1), then uses that value to pick a corresponding horizontal position from right to left across the SmallScreen2 sprite.

    You could say:

    “This calculates the vertical position of the mouse relative to SmallScreen, then maps that position to a horizontal coordinate across SmallScreen2, from its right edge to its left edge.”

  • My time zone is AEST - 10 hours ahead of UTC

  • Perhaps something to do with time zones?

  • Try this:

    -> OffScreenMouse: Set position to (lerp(SmallScreen2.BBoxRight, SmallScreen2.BBoxLeft, unlerp(SmallScreen.BBoxTop, SmallScreen.BBoxBottom, LayerToLayerY(OnscreenMouse.LayerName, SmallScreen.LayerName, OnscreenMouse.X, OnscreenMouse.Y))), lerp(SmallScreen2.BBoxTop, SmallScreen2.BBoxBottom, unlerp(SmallScreen.BBoxLeft, SmallScreen.BBoxRight, LayerToLayerX(OnscreenMouse.LayerName, SmallScreen.LayerName, OnscreenMouse.X, OnscreenMouse.Y))))

    {"is-c3-clipboard-data":true,"type":"actions","items":[{"id":"set-position","objectClass":"OffScreenMouse","parameters":{"x":"lerp(SmallScreen2.BBoxRight, SmallScreen2.BBoxLeft, unlerp(SmallScreen.BBoxTop, SmallScreen.BBoxBottom, LayerToLayerY(OnscreenMouse.LayerName, SmallScreen.LayerName, OnscreenMouse.X, OnscreenMouse.Y)))","y":"lerp(SmallScreen2.BBoxTop, SmallScreen2.BBoxBottom, unlerp(SmallScreen.BBoxLeft, SmallScreen.BBoxRight, LayerToLayerX(OnscreenMouse.LayerName, SmallScreen.LayerName, OnscreenMouse.X, OnscreenMouse.Y)))"}}]}
    
  • I keep telling you to use the hierarchy. Pin behavior is basically deprecated.

  • Use the same approach:

    if any arrow key is down -> set running animation.
    
    if none of the arrow key is down 
    AND none of the on-screen buttons is touched -> set idle animation.
    
    
  • You still didn't remove the HP addon..

    Anyway, you need to use multiple animations, not stopping/starting a single animation.

  • Simply add another condition checking for the right wall object. For example:

    Player has wall on the right
    Player is overlapping WallSprite at offset (+4, 0)
    
  • I would also use a tween, just tweak the values until it looks nice.

    That lerp formula you have is not correct, you need to use delta-time. I advise using another tween for returning to the barracks.

    And, like I said in the previous post - attach sprites with hierarchy instead of Pin. Then you will only need to tween the parent sprite, the gun will scale automatically. You can even spawn the entire hierarchy with one action.

    dropbox.com/scl/fi/hnl18lox5bea53q7p919j/Hierarchy_demo.c3p

  • It now says "File is in owner's trash"

  • The Turret behavior is mostly intended for top-down games. In a platformer, especially if you’re only shooting left and right and there are no flying enemies, you usually don’t need it.

    My advice: don’t use the Turret behavior. Pick the nearest enemy and spawn a bullet in its direction.

    If you really want to use the Turret behavior, create an invisible sprite just for it. This way, you can combine the character and the gun in one sprite and mirror them easily.

    Also, use hierarchy instead of the Pin behavior — child objects in a hierarchy will automatically mirror when the parent sprite is mirrored.

  • So what is your question about - calculating the stars, displaying them?

    Record the number of correct answers. (correct/total)*100 gives you the percentage of correct answers. Then you can decide how many stars to give, say 3 stars for 100%, 2 stars for ≥50% or 1 star if <50%

  • Please bundle all addons.

  • I would try tweaking the pathfinding grid. There are pictures in the documentation explaining how it works:

    construct.net/en/make-games/manuals/construct-3/behavior-reference/pathfinding

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I agree that a warning could be helpful for some new users, but I'm worried most people would ignore it and keep making the same mistake.

    I think the way the event system works tends to encourage beginners to put every action in a new top-level event. The result is the same messy code which I keep seeing almost every day: