calminthenight's Forum Posts

  • Have a look at this. There were issues with screen shake causing movement on your mouse position so to get around this I used absolutemouse positions instead.

    1drv.ms/u/s!AkmrWgxeuxlKhIgsXevC8baOBxWWLw

  • Turn off all of your other events for setting the angles of you lazer and projectileimpulsion.

    Add the events and variables in from my post.

    Replace the "turret" in event #3 in my events with "lazer" from yours. (event #13)

    Now edit the event Projectileimpulsion - set angle to AngleDiffViseurPerso and instead set angle to lazer.angle. (event #18)

    Now the angle of the turret and any spawned projectiles will be set towards the mouse position if the mouse is moving. If the mouse is not moving they will be set to the last angle.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • To determine if the mouse is moving you need to save the mouse's coordinates to variables every frame and then compare them to the current coordinates:

    Use these events:

  • So if you just want your character to do the wake up animation and everything else that is around is fine you can set the initial animation in the editor to be "wake up"

    Then in your events you can use: on wakeup animation finished - set animation to idle.

  • Sounds like you want to do an intro scene for your player before the game starts?

  • You need to share a public link to your game.

    Also physics are physics. You can have all of your objects that interact use them, or not but it is difficult to get good results with interactions between physics and non physics objects/behaviours.

    Without seeing your game, your concept sounds simple enough to implement.

    Give your ball sprite physics behaviour, plus any surfaces that it will contact. You can move the ball by applying physics forces to it. If the ball is on a physics object that is on an angle, it should naturally roll off it.

  • post some screenshots

  • Turn on the 'Isometric' option in the Tile Movement behaviour options.

    Or just don't use default controls and map your movement keys to 45° angles

  • That's interesting because your example shows that pixel rounding is affecting the objects movement at layout coordinates, and not the CSS canvas coordinates, which is in contrast to how it is described in the manual.

    The viewport is 9x9.

    With pixel rounding on the object only moves 1px in layout coordinates when it approaches 1px.

    With pixel rounding off the object can move to fractional positions on the layout.

    However, the CSS canvas size is much larger, depending on the scale, and the effects of pixel rounding are unclear in this example.

    I did realise what was happening though that was confusing for me before.

    In this modified example, scaling is turned off, the canvas size is set to 200x200 and there is a single red pixel. When moving this across the screen it does only move 1 px at a time, regardless of pixel rounding being on or off.

    The issue is with Windows DPI scaling. If the same example is run with 125% scaling on, every 4 layout pixels moved, the single pixel is stretched across 2 css/device pixels even if pixel rounding is on.

    It's unfortunate that pixel rounding is not able to factor in DPI scaling as it makes the feature a bit redundant on a lot of devices. It seems that pixel rounding is a pre-scaling operation, which explains why it does not appear to work when the layout is not perfectly scaled either by Construct or Windows.

    EDIT: It's clear that Windows scaling implementation is the issue. If anyone knows a way to force disable scaling in Chromium I'd be keen to know.

    Example: 1drv.ms/u/s!AkmrWgxeuxlKhIgIJuVIW8clDCyeCw

  • Hi oosyrag I think we might have got a bit confused :) I'm talking about the CSS canvas not the drawing canvas.

    The system expression LayerToCanvasXY should show the CSS co-ordinates above a position in layout co-ordinates for a given layer. My original understanding was that these are the coordinates that objects in the layout are rendered to in the viewport(canvas).

    I guess it boils down to not knowing if when rendering, is the canvas position the rendered position or not? When scaling the layout, I assume that that is placed over the canvas and therefore we can convert layout positions to CSS Canvas positions using that expression.

  • Thanks, I actually just tried the int(self.x,self.y) thing and it does work to limit the objects position in the layout to integers.

    My understanding though was that the Canvas position is representative of the rendered position. So I'm not looking for a way to limit the coordinates on the layout to integers but on the actual canvas itself.

    Using Pixel Rounding 'on' I can see it working whenever set position is used. When off you can see it returning .5 values. However, it does not have the same effect when using movement behaviours.

    Am I wrong in assuming that Canvas position is representative of rendered position?

  • I've been experimenting with a custom scaling method, using fullscreen mode 'off' and wonder if there is a way to limit the coordinates of an object on the canvas to integers?

    Artefacts occur when objects are in fractional positions. Setting pixel rounding to 'on' appears to only apply when objects are moved using set position.

    When objects are moved using the 8dir behaviour for example, their canvas positions become fractional again.

  • Physics behaviours don't interact well with non-physics behaviours. Unfortunately you can't ask something to behave within a physics world and then apply non-physics conditions to it.

  • Diagnosing this without posting your project file or your events and an example is difficult.