dop2000's Forum Posts

  • For text object I have this demo:

    dropbox.com/s/r0i9ly9r4xrtu03/Scirra_TestingSpeechBubbleIssue.capx

    The idea is to use another text object to obtain the width and height of text. It needs to be almost invisible, but not completely invisible (otherwise it will not be rendered), for example you can set its opacity to 0.1% or cover it by some sprite or move almost off the screen.

  • This code makes no sense.. Even with only 1 enemy instance it will not work correctly. When you are near the enemy, the player will start moving by itself, running away up/down from the enemy. If there are multiple enemies on the layout, I can't even imagine what it will do...

    .

    Please explain how the player should be controlled (keyboard, on-screen virtual joystick etc), and how do you want it to be animated. Why are you comparing player position with enemy position? Should the animation change somehow when there is an enemy nearby?

    Also, check out these tutorials:

    scirra.com/tutorials/1117/animation-management-in-8-direction-games

    scirra.com/tutorials/413/direction-based-sprite-animation

    scirra.com/tutorials/344/how-to-setup-a-simple-animation-system-for-8directions-behaiour

    scirra.com/tutorials/791/4-direction-animation

  • Yes. Or use "Set position" instead of Pin for the Window.

    Or I would combine the tab and window sprites into one single sprite.

  • Use find expression.

    System compare two values find(nationalDayName, searchString)>=0

  • That's because of Pin behavior. You are dragging the Tab sprite and Window is pinned to it. Pin behavior updates Window position after all events are finished. That's why there is a lag.

    To fix this set textbox position to the Tab sprite instead. Or combine the tab and window into one sprite. You can resize its collision polygon (clickable area) to be at the top where the tab is.

  • I think you need to move this code (as a sub-event) to the event where you make the walls solid. So something like this:

    On timer "MakeWallsSolidAgain"
    ...Player is overlapping Walls -> Player destroy
    ...Else -> Wall sets solid enabled
    

    The problem is, player may still be considered as overlapping if it's touching the wall. So instead of "is overlapping" you can use another condition - "System pick Walls by overlapping point (player.X, Player.Y)". It will only be triggered if the origin image point of the player sprite is inside the wall.

  • I imagine something like this:

    Red and blue are two different sprites. Yellow dot is the "perception" image point.

  • Web Storage is deprecated, it was replaced by Local Storage. You should still be able to open old projects which use WebStorage, but you can't add it to new projects.

  • Disable "Simplified user interface" in C3 settings. After that you will be able to see Local Storage in the list.

  • Yeah, yoyoEleanor's example is exactly what I meant. You add all sprites to a family, add an instance variable "zsorting" to this family and z-sort by this variable. You can set this variable to sprite.Y or use a different image point or some sophisticated formula. The only drawback of this method is that you can't sort a group of sprites and other objects (say, tiled backgrounds), as it's not possible to add them to one family.

  • See this demo I made for another post:

    dropbox.com/s/lbewjvv6rekd2na/IsometricForest.capx

    .

    Instead of sorting by Y on every tick it's better for performance to add an instance variable and use "System Sort Z Order".

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • daleinen Yes, with non-monospaced fonts you need to loop through each character and use SpriteFont.CharacterWidth(char) to calculate the correct width.

    Another option as R0J0 mentioned here is to use SpriteFont.TextWidth and TextHeight expressions. I believe for sprite font they are available immediately, you don't need to wait for the next tick. So you set text, read these expressions and adjust the box size accordingly.

  • You do not have permission to view this post

  • You can use the official Rotate behavior, but you will need to stop it when the sprite reaches the target angle.

    It's much easier to use this addon:

    c2rexplugins.weebly.com/rex_rotateto.html

    You can also rotate the sprite with events, for example "On every tick set angle to anglelerp(sprite.angle, targetAngle, dt)"

  • Oh, man, you mean when you don't kill the enemy and it disappears below the bottom of the screen - then you want to subtract 1 point? I'm sorry, I misunderstood your, that "Enemy.Y<0" condition confused me.

    Do this: