calminthenight's Forum Posts

  • Your function that repositions the Vara does not know which specific Vara you want to move because you have just told it to move all of them when the function is called. If you are picking a specific instance of an object and you want to do something with that instance only, you need to put the actions within that same event or sub events after the picking has happened. Alternatively you can tell the function which instance you want it to affect but to do that requires extra steps and passing the instance UID as a variable into the function.

    Easy option. Delete events 4,5,6&7. As a sub event under Event 2, add in the Vara is overlapping Collision condition (that was previously event 7) and then add the Vara set position to MenyBlock action (from the function) into that event.

  • In the timeline properties set it to loop

  • I can't replicate that issue, I can see the variable values tweaking slightly as they try to reconcile the movement but it never results in more than a 1 px change from the original position of the viewport to either the right or left. I wouldn't worry about it considering it's unlikely to come up during normal gameplay unless someone was specifically trying to do it.

  • First step is too ease up on those caps.

    Second step:

    On your ValPlayer object in the 8-Direction settings, untick the use default controls option.

    Then you can make the events for your movement control and add any conditions into them. Something like:

    On 'left arrow' is down

    &

    Animation "punch1" is not playing

    &

    Animation "punch2" is not playing - 'ValPlayer' Simulate control left

    On 'right arrow' is down

    &

    Animation "punch1" is not playing

    &

    Animation "punch2" is not playing - 'ValPlayer' Simulate control right

  • Alternatively you could use the solid behaviour and compare player 1 height to player 2. If one is higher and jumping you can set solid disabled on the other to avoid the other player platform issue. Once the jumping player has landed if their X positions are overlapping you can move both players away from each other.

  • When you open Construct, on the home page there will be some demo projects displayed. Look for one called "Glokar" it will help you understand what to do. If it is not on your homepage, type "glokar" into the search bar.

  • Hey, the Y issue in the families example is because I was lazy and didn't think about jumping. As the player moves up the screen their distance to the middle of the closest viewport is reduced and the variable will be set to their position. Using the non-families method won't have the issue because it is comparing each players x position to the other and not comparing the distance to the edge of screen or any Y values.

    As for the warping through the blocker, no idea on that one sorry. None of the code for the camera influences the movement behavior in any way. The standard platform behaviour shouldn't be able to move through a solid. Even if the viewport was shifting position when a player was jumping, the jumping player should just be pushed backwards as the solid blocker moved back. It could be some edge of use bug when a platformer and a solid object are moving against each other.

  • In your layout you have all 3 colours present offscreen at startup and you are then setting them all to the same position and telling them all to to do things at runtime. Your last events are spawning new playeranimations every tick which is why you are seeing many of them

    To solve the problem you have, you need to delete the red and yellow playeranimation objects from the layout in the editor, remove the destroy player actions you have and then add the destroy player actions for the remaining colours in events 36,37 & 38. Also add a 'trigger once while true' condition to the bottom of these events. This will get the game functioning. See attached file. 1drv.ms/u/s!AkmrWgxeuxlKhIc4iUkvbuYBV-bCLQ

    This is however not a very good way to lay out your code. You would be better off using sub events and organising your player animations/actions etc underneath the parent events of 'playercolor=1' 'playercolor=2' etc. I would suggest moving all of your colour animations into a single object and naming them yellowrun, bluerun etc. Have a look at this version to see what I'm talking about. I have moved all of your player controls to Events 26-40. 1drv.ms/u/s!AkmrWgxeuxlKhIc5iOcuSbRLVwrTfA

    Mega Man Rocks.

  • Hi WatermelonFrogy

    I saw this post and another of yours and thought that you might not be aware of the C3 manual. It is really well organised and searchable and contains all the information for these basic questions. Have a read, it is really helpful.

    construct.net/en/make-games/manuals/construct-3

    In answer to what I think your specific question is, when you create the variable you need to set its type to "string". This variable can store text strings. Number variables can only store valid numbers.

    Otherwise if you are just looking how to store a value in a variable please have a look at the manual entries.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Not at all, it was a demonstration for you to learn from and use however you like. If you look at the layers window in the editor you will notice that there are two layers. Layer 0 is the layer that most of the stuff is on and layer 1 is the layer where the blockers live. With that layer selected, up in the properties section you will see that parallax X&Y are both set to 0. This means that anything on this layer will remain where it is regardless of if scrolling is happening. Parallax at 0 is used a lot for UI elements etc.

    When setting up objects on a 0 parallax layer you have to remember that they are relative to the viewport, not layout. So in the editor make sure you set them to the correct position on the viewport, or position them accordingly using events at runtime.

  • You do not have permission to view this post

  • Titan Games The example I posted earlier in the thread does what you are trying to do. You only need to replace the event that assigns the UID with your On Touch event, and the event that removes the target when it is destroyed to remove the target when line of sight is lost.

  • A camera to follow a player smoothly for a side-scrolling platformer can be done in one event using:

    Set Scroll X - lerp(scrollX,playerobject.X,0.2) This will give you a smooth horizontal scroll using linear interpolation. You can adjust the speed by tweaking the 3rd number to a value between 0 and 1.

    For more than one player I have attached an example that, as you mentioned, finds the midpoint between the first and last player and then applies the same logic as the single player scroll. There are blocking objects placed at the left and right edges of the viewport to prevent a player from disappearing off-screen.

    The method also encourages moving right as the farthest right player will move the camera up until the point that the farthest left player is touching the screen edge. If the farthest left player then moves right, the camera will continue to move forward until it reaches its intended position.

    I have included a method for using families (if you have a license) and for not using families.

    Let me know if you have any questions :)

    1drv.ms/u/s!AkmrWgxeuxlKhIc3pPm0W1AeqXZWZA

  • If you are setting the other layers to be invisible then you can add to your on sprite clicked event: "Is layer x visible" (where x is the layer that the sprite is on).

    This will only allow sprites on the active layer to be interacted with.

  • Ok easy fix. Because you have two 'on start of layout events' with the ajax 'on completed' event in between them it looks like they would trigger in order from top to bottom. However, what actually happens is that both of the on start of layout events trigger first (because it's the start of the layout) and then the ajax on completed event triggers. So the reason your RankTxt displays 0 is because there is no data loaded into the array yet when you are asking the text to be set.

    Move your set text action to event #6 and place it after the 'RankArray' Set value action.

    Also you need to increase the size of your text box, or decrease the font size as some of the larger names won't display.