BigBuckBunny's Forum Posts

  • In Construct you can create and edit .txt files if you wish. Simply right click on Files and select New -> Plain Text

  • There is not a specific expression for that, but you can calculate the exact number using events.

    The number of line wraps is equal to the textHeight of the full text (line height offset excluded) divided by the textHeight of a single character / line.

    Here's a working prototype: dropbox.com/scl/fi/jmccjnkc9tdvmhchvl8qe/Line-wrap.c3p

    Note that modifying the text appearence at runtime is needed for the calculations to work.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you want to keep the animation when the player is moving to the other side of the screen, you need to have a copy of your player sprite that can handle that animation while the sprite is at the other side of the screen.

    Basically, as soon as the player leaves the layout, you teleport it on the other side of the screen, and you place your player copy where the player previously was. Then you animate the player copy.

    I made an example project to show you how to do this. Note that i don't use the wrap behaviour for the player (implementin it is just 4 events). The animation itself is done with the tween behaviour. If you go in debug mode, you'll see that the player is inside the screen at all times.

    Here's the project: dropbox.com/scl/fi/d4ab0aolo0vkmm2pueway/Tile-movement-warp.c3p

    I suggest not to have a player of size different from the cell size. That could cause bugs in the future that will be hard to find.

  • You can stack various tiled backgrounds on top of each other in a single layer, and then change the OffsetX property of each background individually at an increasingly lower rate to fake the 3d parallax.

    You can do the same thing with more layers if you wish.

  • Two things that instantly come to mind are families and hierarchy.

    You should group your panels into a single family, so that you can call actions on all panels at once. Do the same for the text.

    When you tap an object of the panels family, you first reset the 10 pixels offset of all panels using the family, and then apply the 10 pixel offset only to the desided panel.

    You can also avoid having to move the text of each panel by using hierarchies. Simply set each text as a child of its panel (with the y position constraint) and then each time you move your panel on the Y axis, the child will move automatically without needing to write additional events.

  • When the sprite is in direct contact with the wall and the collision polygon changes, the polygon itself may overlap with the wall. When this happens, the engine assumes that the sprite is passing through the wall and instantly pushes it out. Shortly after, however, the collision polygon changes again, and the cycle repeats. Each time this occurs, the sprite's position shifts abruptly, and if the camera follows the exact position of the sprite, it results in a screenshake effect that you see.

  • There are a lot of factors in play which could cause this. First of all, make sure that your sound is exactly 9.6 seconds long. Then check your Audio Output Latency, since that plays a role in these situations.

    Even then, as oosyrag suggests, it seems that you're building up errors over time. I tried setting up a small project and I notice the problem too.

    A solution which seems to be working is to calculate the difference between the expected playback time of the sound and the actual playback time, and use that difference to slow down / speed up the tween so that it is always synced.

    Give it a try: dropbox.com/scl/fi/sc8ehxu0njhg8lfs3cin0/Sound-issue-fix.c3p

  • Normally that doesn't happen if everything is set up properly. Also, the invisible box isn't a bad idea, a lot of games use that same technique.

    Can you check and make sure that the collision polygon for your character is the same for each frame? If your character has an animation playing but the collision polygon changes during the animation, the character won't stay still when touching the wall.

    To fix this, simply pick the smallest (lowest width/height) frame, and set the collision polygon of each frame to that of the smallest one.

    If your character doesn’t have an animation, the issue might stem from a different problem. In that case a project file would be useful.

  • The way you save the recording looks good. If you want to play that data back, one way to do that is to get the data from the BinaryData object in Base64 format using BinaryData.GetBase64. Assign the data in that format to a string local variable (i'll call it Base64String).

    Now you have to use the Add Remote URL action (Audio) to add the recording so that you can play it. Since the URL you pass to the action itself will be applied to the src field of the html audio element, you can pass as URL "data:audio/mp3;base64,"&Base64String and leave the other parameters unchanged (except for the name) to be able to play your sound by name.

    I tried this solution and it works fine, even though there may be more efficient ways to do the same thing. Give it a try :)

  • Right click the family folder in the project bar and select add family. Note that objects of a family must be of the same type (ex: you cannot have sprite and text in the same family). For more information check the manual: https://www.construct.net/en/make-games/manuals/construct-3/project-primitives/objects/families

  • If you want to delete all enemies in between the UP arrow and the DOWN arrow (included) you must filter the enemies of the same column that have Y <= UParrow.Y and Y >= DOWNarrow.Y.

    When you detect a UP arrow enemy that touches the ground, you should call a function that does that for you. That function should pick the enemies in between and delete them.

    Here's a working prototype:

    c3p: dropbox.com/scl/fi/86x19cm0ap8p609a4osns/EnemiesInBetweenPrototype.c3p

  • Your project lacks a lot of organization, that's sure. I tried taking a look, but changing something seems to generate other bugs, which is often a sign of a deeper issue.

    Here your main problem is that you are checking conditions at every tick. When you have a condition in the event sheet without a green arrow next to it, that condition is checked every tick. That means that, if the condition is met, the associated actions keep running as long as the condition is met. In your case that's a problem. You can use a condition called "Trigger Once" that changes the behavior of the attached conditions by firing the actions only the first time the conditions are met.

    Try the code in the image.

    Also, note that on line 111 you have On "Players Array" completed -> set player text. Removing that line seems to solve the issue of the text changing briefly before the players appear.

    I see that you don't use families, actions, functions and much more. There are a lot of things in Construct which can help you avoid unnecessary work (notice that most of your events repeat things over and over). I made a small example of a basic prototype of your app (only virus) that uses these things.

    dropbox.com/scl/fi/nkytxmktzjv6g5q6xvjnm/DemoImproved-1.c3p

  • It depends on the type of game you're making. If you're developing a platformer using the Platformer behavior, then you can use Platform has wall to right/left and Platform is on floor to check for bottom and side collision. To check for collisions with ceiling, simply test the overlap at ofset using Object is overlapping at offset 0 -5.

    If you are making a top-down game with a fixed size grid and grid-based movement, you should calculate the tile x and tile y at the player's position, and then check for neighbouring tiles using Compare Tile at Tile x Tile y

    Otherwise just use Object is overlapping at offset x y with offset that correspond to the 4 directions.

  • Thank you Ashley! That works! However, I'm unable to find the instance class for 9Patch objects. I think they don't have one (?). Is there any way I can tell if an instance is a 9Patch?

  • I encountered an issue where the editor would completely freeze for several minutes before resuming and working flawlessly again. This happened with a fairly large project (approximately 1,500 events and 2,000 lines of JavaScript). Interestingly, the freezing only occurred when positioning objects in the layout. While working in the event sheet, the editor never froze, though it did feel noticeably slower, especially when deleting events.

    To potentially improve performance, I tried organizing events into groups and keeping only the group I was actively working on open. While I think this made navigation a bit smoother and may have reduced some of the sluggishness in the event sheet, I’m not entirely sure it had a significant impact. It could be worth experimenting with, but the results might vary.