bartalluyn's Forum Posts

  • I created a video, check it out, I think that is about what you want.

    drive.google.com/file/d/1oERBtxw27AovJhIYt7A0juyXCnfp-VTx/view

    If want to get some more understanding of Construct, and general tips and tricks, check out my youtube playlist.

    youtube.com/playlist

  • Yes, some of them show how to write and read a highscore from and to local storage. The same principals apply for other things like JSON strings or so.

  • Maybe it's better to explain exactly what you want to do functionally.

  • What confuses me most here, is that you are asuming that this is an event. The set animation from is an action. Depending on where you call the action, it will do that only once, or many times.

    So for example, if you want to do it when the game launches, uses the "on start of layout" event, and call "set animation frame" there. If you want to do it when a another event happens, for example the player dies, do it in the event where the player dies, for example, the same event where you set the health to 0.

    Or, you just do it on every tick and use the trigger only once while true condition. But that's not what I would recommend

  • Indeed, give the orbit behavior to the ball, and make sure the offset angle property is the radius of the circle

  • looking to the context, I would assume that you only have 1 game over panel?

    why do you create an extra one?

    so, either it exists, and you just pick it.

    Or it doesn't exist, and picking becomes unnecessary, and you create it.

    Both doing both confuses me a bit.

  • You should only create 31 labels with text 1 to 31 and hide 31,30 or 29 according to the month in the year taking into account the leap year. If the year can be divided by 4 it is a leap year, but not if it is dividable by 100 and yet again it is if it is divisible by 400, so very simple to implement with a function taking a year as a parameter, and returning a number 1 or 0:

    * On function 'IsLeapYear'

    * Parameter 'year' (Number)

    -> Functions: Set return value (year%4) = 0 ? (year%100) = 0 ? (year%400) = 0 ? 1 : 0 : 1 : 0

    I think that, if you wait for the next stable release of C3, there is a new date plugin that will be able to tell you the week day of a given date (value 0 to 6) corresponding to mon, tue, wed...

    Get the day (0-6) of the specified date according to universal time.

    text.plugins.date.expressions.getUTCDay

    Hope that helps

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Indeed, there are many tutorials for beginners, but let me take the liberty of promoting my own.

    You'll get a lot of useful insights from these examples I think

    youtube.com/playlist

  • Just doing the same thing, but first picking all the assets on the layer you want. The easiest way is using "pick by evaluate":

    + System: Pick Sprite by evaluating Sprite.LayerName = "myLayer"

    -> Sprite: Tween "" property Position to 10, 10 in 0.5 seconds (Default, destroy: No)

  • You do not have permission to view this post

  • Hi,

    Making it appear: if it is already on the layout just set the opacity to 100 or visibility to "visible".

    If not, just create the object and use the tween behavior.

    Make sure you use the "tween 2 properties" action

    + Keyboard: On Space pressed

    -> System: Create object enemy on layer 0 at (0, 0)

    -> enemy: Tween "" property Position to 10, 10 in 0.5 seconds (Default, destroy: No)

    Alternatively: use timelines, but that's probably overkill here.

    If it's not necessary to do it in exactly 0.5 seconds you can also use MoveTo, that depends on the speed you set the MoveTo behavior. There are many examples in my playlist of using the MoveTo behavior.

    youtube.com/playlist

    hope that helps

  • I wouldn't use tile movement here if I were you. Maybe MoveTo is a better choice?

    + player: Has LineOfSight to enemy

    -> enemy: Set MoveTo enabled True

    -> enemy: Move to player (Direct)

    + player: [X] Has LineOfSight to enemy

    -> enemy: Set MoveTo enabled False

    Just make sure to tweak the speed of the enemy and the player.

    If you get issues with solids blocking the way, an alternative would be using the pathfinding behavior to find a path, and use the Move to behavior to move along the path using waypoints.

    Hope that helps

  • I'm not sure I fully understand the question, but first thing that comes to mind is,

    when going to the game layout, just loop through the peers using a for loop

    + System: For "" from 0 to Multiplayer.PeerCount-1

    -> Text: Set text to Multiplayer.PeerIDAt(LoopIndex)

    but instead of setting some text create your player sprite and setting the peerid variable with Multiplayer.PeerIDAt(LoopIndex)

    but maybe I don't understand your question correctly

  • I agree in saying this is a pretty bad Idea.

    What you could do is create one giant sprite with the grid pattern on it. Say your grid size is 64x64 pixels, you can easily determine which grid space your mouse cursor is on with some simple math:

    grid x = floor(mouse.x/64)

    grid y = floor(mouse.y/64)

    just make sure the giant sprite starts at the origin of the layout.

    Or, if you do want to use individual sprites, make your layout smaller, your grid squares larges and of course use only 1 grid sprite and spawn them at runtime on layout start for example.

    In my playlist I have several examples of games spawning stuff at runtime: jewels, bubbles, tiles, etc. No grids, but the principal is the same.

    But maybe I misunderstood your requirement of course

    youtube.com/playlist

  • I think you should use On Key down instead of On Key Pressed

    + Keyboard: E is down

    + Keyboard: F is down

    -> Text: Set text to "hello"