calminthenight's Recent Forum Activity

  • 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.

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • Firstly try using int(random(0,999)) rather than round. The last image in your gallery "code woes" doesn't display. It is easier to get help if you post a link to your project file so people can open it up and have a look :)

  • From my experience, as you mentioned, using overlays/masks is always heavy on the GPU. If you can avoid any overlapping sprites with transparency and bake it in to the scene it helps a bunch. Otherwise there is the option of low fullscreen quality which may or may not work depending on your content.

    From the manual: > "This only applies when the viewport is being stretched (i.e. Fullscreen mode is not Off). High quality mode renders at the full resolution of the displayed size. Low quality mode first renders at the project viewport size, and then simply stretches the result to fill the screen. Low quality mode often improves performance on low-end systems and is often suitable for retro-style pixellated games with Point sampling. However note that text, downscaled sprites and effects will appear with better detail in high quality mode."

    Having the viewport size/scale set at the appropriate amount will also help. For example if your project is set to 1920x1080 and the window size is smaller than that and requires down-scaling, in my experience that eats a lot of FPS. I'm not sure how it works with upscaling but if your project is set at 1366x768 and is being displayed on a 1080p device I imagine that also has a detrimental effect on FPS.

    EDIT: also this thread talks about using "pre-load images" and then if you are going to create any images at runtime, have them positioned offscreen first and then destroyed at startup. construct.net/en/forum/construct-3/how-do-i-8/preload-images-sprites-appear-145016

  • It sounds like you have multiple objects with variables so you should be able to destroy them when you need without using this method, especially because if you are going to be able to pass the name that means you should be able to destroy it anyway.

    Something like:

    If item1 var_amount = 0 destroy item 1

    If item2 var_amount = 0 destroy item 2

    Or if you are using paid version you can use a family and add all the inventory items:

    If family"items" var_amount = 0 destroy items

    However if you want to pass a string to a function, in the event that you call the function, before the function call action, store the name in a local/global variable, and then check that variable inside the function, and at the end of the function clear the variable.

calminthenight's avatar

calminthenight

Member since 28 Jan, 2018

Twitter
calminthenight has 6 followers

Trophy Case

  • 6-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

11/44
How to earn trophies