shirokuma's Forum Posts

  • ...the movement isn't smooth though

    Are you talking about how the probe swings wildly when it's dragged near the starting point of the wire? Or is there another issue?

    If it is the issue you could disable the lines of code that rotate the black probe towards the starting point of the wire. So the probe would always stay at it's original angle.

    You might also consider moving the multimeter so that you are not trying to probe a point right next to it.

    If you don't want to move the multimeter you could stop adjusting the angle of the probe when it's within a certain distance of the multimeter.

  • rayray - Yeah, it's probably a little too abusive. Of course maybe that's a new game genre.

  • Something like this:

  • Here it is with just what you need:

  • I was playing around with text entry earlier and came up with this. You should be able to glean what you need from the code in the "Walk Away" or "Walk Here" section.

  • Here you go. You start off wearing the Green Suit, and when you buy the Blue Suit you start wearing it.

  • Both lerp and CanvasToLayerY can be found here:

    https://www.scirra.com/manual/126/system-expressions

    [quote:3kvp8g7r]CanvasToLayerY(layer)

    Calculate the layout co-ordinates underneath a position in canvas co-ordinates for a given layer.

    and

    [quote:3kvp8g7r]lerp(a, b, x) Linear interpolation of a to b by x. Calculates a + x * (b - a)

    So lerp will move from a to b by x.

    For a we want the Y position on the layout of where the camera is centered. This is our starting point. So for that I used CanvasToCenterY(Layer#, X, Y). I didn't see the requirements inside the parenthesis in the manual, but that is what is needed.

    For b of the lerp expression I use the Y value of the sprite.

    And for x I use 0.05.

    My brain is hurting again just thinking about this... <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • Well, I'm not very happy with this one, and it certainly isn't efficient. But maybe it will give you some ideas.

  • Here you go. I made the item to buy a badge that attaches to the character at a certain location. Once you purchase it you wear it in all the layouts. I also added persistence to the gold, so when you leave and come back into the treasure room the game remembers how much gold is left.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm looking forward to playing it.

  • I wasn't able to open LittleStain's file since it was made with a Beta version of C2, so maybe you already have a solution you like. If not here is a 2 line solution.

    Basically I have the system check every tick to see if the angle between the sprite and the mouse is within a range that I specify. If it is I update the angle of the sprite. So as the mouse moves out of range the angle of the sprite is no longer updated and left at the last angle instead of snapping back to 0 as in my previous example.

  • Are you looking for something like this:

  • Give this a try. Click on the blue box to take a screen capture. (For some reason it happens on the second time you click the box.) I load the screen capture into a rotating sprite, so you will see it when the capture happens. Click on the red bar to move to another layout. (You can click on the red bar in the second layout to return to the first.)

    FYI: if you really want to mess with your head click on the blue box 3 or more times...

  • Here is a start. If the canon goes beyond 55 degrees from 0 either direction it snaps back to 0 degrees.

  • So is it possible that the enemies are too close to the player? And so would need to move away from the player to get into proper range? Or are they always going to be farther away and you just want them to move in to proper range?

    Do you want diagonal movement for the enemies? Can they move to the player's Y, and then move up into range?