InDWrekt's Forum Posts

  • drive.google.com/file/d/11KwhVVbjS2fB_KaTPDuKY-CLArBW6Wf6/view

    Hopefully this example gets you what you need. Just click the card and it will flip over.

  • I don't have an answer to solve your problem but I do think you uncovered a bug. See the 2 attached pictures.

    I debugged your project to see if I could see what was going on and this is what I found:

    I stretched the bottom left corner of the mesh to the left until it was nearly touching the left side of the screen. I then rotated it until the 2 left sides were aligned with each other. In the debugger, I took screenshots of the oleft and sprite2(0).x values.

    The first image shows the x coordinate of the Sprite2 object on the far left side which should be your sprites bboxleft value. The second image shows the the value that was stored in the oleft variable. This should be the same as the first value but they definitely aren't. I am not an expert with the mesh object but from all I can see, your events should work fine, the system is just not getting the correct bounding box values from a mesh that has been deformed and then rotated.

    I would suggest you submit this as a bug.

  • First thing I am going to say is, you may want to take a step back and work through a few more basic tutorials before trying this project. You may not be ready yet. Each answer seems to lead to more questions which means you really could use some more experience with the engine (and game design in general). This isn't meant to discourage you. In fact, struggling with a bigger project than you are ready to complete is the more discouraging thing here and after getting some more knowhow first will lead to a better project in the end.

    That being said, Here is an example file that I hope can show you how to solve these problems.

    drive.google.com/file/d/1vXpKAC46NGnCxcb4O7n_P8i31WQ1m9dB/view

    The game freezing is caused by an endless loop. This means the while loop used to draw your ray is never finding an end point so it is continuing off into infinity. The events that happen after the loop are never reached and eventually the computer will run out of memory. This is solved simply by guaranteeing the ray stops growing at some point. In the example, I give it a max length as one of the conditions for the while loop. Any time you are using a while loop in your game, if the game freezes, the first thing to check is if there is an endless loop.

    Again, for the angle of the arrow, I will have to make some assumptions. I assume you are using the orbit behavior. This would seem to make sense because you want it to orbit the heart. However, some of the functionality of the orbit behavior (the way it rotates the object for example) is not compatible with the result you are looking for. For my example, I found it better to use the rotate behavior and set the origin of the arrow a little to the left of the sprite. To see this, edit the sprite and look at the position of the origin. If you then set the position of the arrow to the position of the heart, the rotate behavior will rotate the arrow around the arrows origin causing it to appear to orbit the heart. I then pinned the arrow to the heart, without allowing the pin to set the rotation, to ensure the arrow stays with the heart.

    There are of course other ways to fix the angle. For example, you could disable the orbit functions rotate property and use events to manually set the angle. But I'm lazy so I would rather not do that extra work.

    You'll notice the player uses a variable to ensure the teleport isn't automatically triggered on arrival at the end destination.

  • You haven't given public access to that project but I requested access. You will have to accept my request.

    That being said, You should take a look at the example mrcgkh posted in this thread. It uses an instance variable that gets set when the player enters the portal and only gets reset when the player is no longer touching a portal.

  • This looks like the perfect situation to make use of containers. Take a look at this example:

    drive.google.com/file/d/1qtqeuNNF2tIfZhLrBABtfWaohX1VBLSh/view

    In the example, there is a plate and 3 different food items that are all separate sprites. They have been added to a container (https://www.construct.net/en/make-games/manuals/construct-3/project-primitives/objects/containers). When you spawn/destroy a single object in a container, all other objects are spawned/destroyed.

  • Without the project, I have to make a few assumptions. What I would suggest first is, make sure your character doesn't overlap the exit portal when teleporting to it. There is a chance that the character teleports but is immediately teleported back to the entrance portal.

    Ways to test would be to disable the exit portal events and just use the entrance portal. If the teleport works, check to see if the sprites overlap.

    If you disable the exit portal events but the character still doesn't teleport, there is something wrong with how your event is set up.

  • The blurring is caused by the computer trying to keep the image as accurate as it can while trying to draw pixels between where they can be drawn. The computer can easily figure out where each pixel goes if you rotate the object 90 degrees because each pixel will be inside the pixel grid. But, if you try to rotate it 30 degrees, most of the pixels in the image will try to draw outside of the pixel grid so the computer has to interpret what the image should look like. This same thing happens if you pull your sprite up in a drawing program like photoshop. Have you tried changing the "Set Angle" property to 45 degrees instead of smooth? At 45 degrees, the computer can usually do a good job of interpreting how the image should look.

    Another option is to disable the "Set Angle" property and instead, draw your sprite facing each of the 8 directions and, in code, switch to the correct image dependent on the direction the character is moving.

    As for the jittery movement, either of the above options will reduce it dramatically. You will still see some because at the resolution your project is running at, the pixels are big enough to differentiate between so you are seeing the object move from 1 pixel to the next.

    This is a long one but I hope one of these suggestions helps. Good luck with you project.

  • Glad to help.

  • I think what you are looking for is the "System->Create Object by Name" action.

  • > Try out this sample project. It uses a simplistic form of raytracing. That means, it draws a line (casts a ray) from the arrow to the wall. To see the ray, just disable the Ray Destroy action.

    >

    > drive.google.com/file/d/1Aj8mMS1FvkMsbzUVTBarXNBRPpXNYWgV/view

    Ok I just tried it and put it into my project with some minor modifications (like the mouse thing since I don't need that since the arrow I have is orbiting the soul until I press z) and it doesn't work exactly as expected since the walls I have are actually four different sprites in one family, so instead of the ray just going straight at all times, it just goes off course and goes to the nearest wall, as opposed to where it is pointing.

    this is the code that I got so far for the arrow

    and this is what the ray and burrow entrance do when I press z, it just goes down to the nearest wall instead of going straight at all times

    First, it is much easier to help with issues like this if you give access to your project.

    Second, I don't think the problem is what you think it is. From your image, the ray is shooting off to the right of the arrow. I also notice the arrow sprite was DRAWN pointing up. In Construct, the default direction of a sprite is facing to the right. I think the issue of the ray shooting off in the wrong direction is caused but your sprite being drawn facing the wrong way. If you edit the sprite image so the arrow is drawn pointing to the right, you'll get the correct result. Draw the sprite pointing to the right, and then, in the layout, rotate it to face the direction you want.

  • Try out this sample project. It uses a simplistic form of raytracing. That means, it draws a line (casts a ray) from the arrow to the wall. To see the ray, just disable the Ray Destroy action.

    drive.google.com/file/d/1Aj8mMS1FvkMsbzUVTBarXNBRPpXNYWgV/view

  • You do not have permission to view this post

  • I asked this same question on the Spriter forums. I was told that an update to the plugin is on it's way. Until the plugin is updated, the manual method I outlined is the correct way to handle updating the animation.

  • Glad to help. Good luck with your project.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads