lukezero's Forum Posts

  • I kindly ask again: does anyone here have a short example, CAPX or C3, of a basic functional behavior of an enemy with patrol behavior for a 2D platform game?

    I really need it urgently, amidst a thousand demands for an educational game with a very small team. :(

  • Do you mean a patrolling enemy that changes direction when it reaches the platform edge? You can put invisible sprites at the end of the platform, when it touches one of them toggle a boolean that relates to simulating left/right on the enemy platform behaviour.

    I would like a solution that does not require a physical barrier, that works in a more universal and adaptable way. There will not always be a wall in front of the enemy. Sometimes there will be a precipice.

  • Take a look at the Kiwi Story game in the examples, it has an enemy with this patrolling behaviour.

    I don't have a C3 license, so I can't fully access the project. :(

  • Hi guys!

    Does anyone have a project file (C2/C3) for a basic routine for the patrol enemy behavior of a typical platform game?

    The kind that walks around autonomously, always turning back when it comes across the edge of a platform.

    Thank you for your attention and collaboration as always!

  • I don’t have an example. But since you only use C2 a non third party solution could be to load the image you want to sheer into the sprite’s animations as a sprite sheet. So say the image is 320x64 you’d import that image with spriteSheet import with 1,64. That would give you a bunch of 1 pixel tall strips of the image. Be sure to set the animation speed to 0. And probably set the origin to the top left.

    Next is to place it. It’s a pain to place 64 instances and set the frame of each one so you can do that with some events:

    Start of layout
    Repeat 64 times
    — create sprite at (0, 480-64+loopindex)
    — sprite: set animation frame to loopindex

    Then to sheer right you can do:

    Sprite: set x to self.x+lerp(10,100, self.iid/64)*dt

    Where 10 is the speed of the top row and 100 is the speed of the bottom. Tune the values to your liking. Moving left would just be subtracting.

    You can avoid the image slicing step by using a tiledbg. The con with that is there will be more overdraw and the sides of the sheer will look off

    Start of layout
    Repeat 64 times
    — create tiledbg at (0, 480-64)
    — tiledbg: set height to 64-loopindex

    And

    Tiledbg: set x to self.x+lerp(100,10, self.iid/64)*dt

    Notice the 10 and 100 are reversed.

    Beyond that you could use a third party plugin to do a sheer. Paster is one option with its draw textured quad action. You’d basically just select a sprite to get the texture, and set the four corner positions.

    Thanks a lot! You're the man! :D

  • You could also apply a sheer with mesh distort if you want to do it in the same way they did it in sf2. Basically make a 2x2 mesh and move the top two points left or right by the same amount.

    Thanks, dude!

    Do you have an example of this?

    I ask because I'm a designer, not a programmer. ^^

  • You can use 3D objects in a 2D game. See the official Gravity Portal example.

    Thanks, man.

    I known it, but I'm using C2. :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi guys!

    How do I make a floor in a 2D platform game have a depth and perspective effect similar to Street Fighter 2? The floor should only scroll as the player walks on the platform.

    Thank you for your usual collaboration!

  • I think you can download it now.

    Thanks!

    I already download it!

    Every object has Physics behavior and the main platform has not the Solid behavior.

    Still doesn't work here. Testing right now. :/

  • > Your suggestion is that at the beginning of the stage I attach a circle to the character with physics behavior and after it is launched I destroy it?

    >

    Yes, or you can simply enable and disable the Physics Behavior for the circle.

    > Can you share this CAPX example with us?

    >

    Of course.

    Here is the .c3p file: drive.google.com/file/d/1h-v7v8axWPuPH8PBD6-3B-bF4teeo7a-/view

    I had already started testing, but without success.

    NOTE: Please allow access to the file. Thanks!

  • Subscribe to Construct videos now

    Your suggestion is that at the beginning of the stage I attach a circle to the character with physics behavior and after it is launched I destroy it?

    Can you share this CAPX example with us?

    Thanks!

  • Hi gamedev pals!

    How do I make the player's character slide smoothly along a wall (without friction, quickly indeed), which in turn propels him to the right?

    Below is an image of what I want in the platform game.

    Thanks!

  • Just a tip. When you get more knowledge in C3. Using AI might help you. For example, if you may want to make a 3D ray cast for collision detection, you can ask AI on how to make it on JavaScript or a PseudoCode and try to convert it to C3 events. Maybe it could get it wrong, but sometimes it can be a workaround to make you understand the process to achieve what you need.

    Yeah, thanks for the tip! :)

  • > I found some strange routines expressed by the AI.

    I really don't recommend using it for Construct. As a test I asked it a few C3-related questions and the results were total nonsense (although seemingly convincing).

    I agree, man.

    There are some confuse routines expressed by ChatGPT. :(

  • Use "For each (ordered)" condition

    Thank you very much! :D