CJacobsSA's Forum Posts

  • I'm still a pretty big novice when it comes to Construct 2 and I don't know if this can be done without plugins or real code, so here's a doodle to demonstrate what I'd like to have happen:

    (open the pic in a new tab if it gets cut off)

    Basically, when the player hits the enemy, I want the enemy to fly in a parabolic arc (I'd like to be able to set the angle, for different attacks) and bounce when they hit the ground, losing a set amount of momentum for each time they bounce until they are stationary. I'm pretty much lost on how to implement this into my game code wise. If I need a plugin to make it possible/easier let me know and I'll grab it.

  • Just double posting to say never mind, I figured it out! All I had to do was make an exception to the 'set animation to run/stand' events that specified that the pre jump timer was at 0 or else they would not play, and then I was able to practically copy over the code I made for the landing. Sometimes a nice walk to clear your head does wonders!

  • In Castlevania, there is a small delay between when the player presses the jump button and when the character actually jumps. In this time (about 1/4th of a second), the character stops moving and does a small crouching animation. When the animation finishes, the character jumps.

    Now, in theory, all I would have to do is make it so that when the player presses the jump button, disable the platform behavior, wait .25 sec, then re-enable it and simulate jump. That works just fine, but the animation does not, and I can't figure out why.

    Here is my current code setup. You can see highlighted in the image that I have the pre-jump animation set before the wait (it does not repeat and has infinite length), but it doesn't play. Instead, the walking animation plays if you're moving before you hit Z or the standing animation if you're standing still.

    You can see that I also have set up a system for when the player lands AFTER a jump, and that works totally fine without issue, but I cannot figure out how to implement the reverse for stopping before the player jumps.

  • Ah, okay, I've got it now. I didn't know you could just do a 'compare variable' condition in that situation! Thank you for the help!

  • I don't know how to use it for my picking. I did say I was unable to figure it out in my above post.

  • Just double posting to say that I was messing around with it while waiting for a response and I found a solution by modifying my code as such:

    I couldn't figure out how to get it to pick the level button by the variable, so instead I used Pick by UID to select the specific button I want the sprite to move to. Then I do my LiteTween function as before and it moves toward the button.

    If anyone has a better solution I would love to hear it, but this is what I've found works for now.

  • This thread is sort of a sequel to a previous thread I made:

    viewtopic.php?f=147&t=122741&p=874659

    You might want to read that one first, it's only like 3 posts long. I'm having another, separate but similar problem to that one. I previously used the LiteTween plugin to move my map character between map squares on the grid (Mario Bros. 3 style) and it worked well because each button was a separate object that I could point it to move towards, like so:

    But I don't know how to make this work with the new system made using the previous thread's solution where the level button is just one object with different instances. Any ideas? Is there a way to, say, point the character object toward the level button that has "atlevel=2" as its value and so on?

  • snipped, I figure it warrants its own thread so I made one for it

  • Ah, thank you, this works nicely. I appreciate the help.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm not entirely sure how to do that but I think I'm halfway there. In order for the game to know what level the player will be going to, I have a global variable called 'atLevel' which is set whenever the player box object overlaps one of the level "buttons" like so:

    How can I make it so that the game sets the player to the button that has the corresponding 'atLevel' value? Like if level 2's 'atLevel' value is 2, how would I set the player there coming out of a level? I don't have to do 'System > atLevel = 2 > Playerbox_Map > Set position to level2button' etc. for every level button do I? Is there a more condensed way to do it?

  • So, in my game I have a map screen, Mario Bros 3 style, where the player moves on a grid from level to level like so:

    The problem I'm having is that I don't know how to make the game remember what level the player is at once they enter it. If the player, say, goes to level 2 and completes it, the game puts them back on the level 1 square when they leave the level and go back to the map because that's the default position. How do I make it so that the game remembers the player's position on the map screen?

  • You can use The Litetween Behavior.

    [attachment=0:3c05jqpx][/attachment:3c05jqpx]

    Ah, this works well, thank you! I had no idea this behavior/plugin existed!

  • Hello. I have a small question I think will be pretty simple to answer.

    I made a quick test of a basic map screen and right now I am figuring out how to make the player move on a grid-based system. I have the movement figured out correctly but the problem I'm having is that I don't know how to make the player stop in the center of the node.

    Right now, the event is set to make the player stop when they overlap it just so I can make sure the movement action itself is working properly. So, how do I make it so that the player stops in the middle of the node instead of when they touch the edge of it? I will attach the .capx file so you can look at it and see if you can help me out. I'm sure the answer is simple, I just don't know what it is and can't find it elsewhere!

  • Bumping my own thread because things broke immediately after I tried to add another animation. I think I'm just gonna upload the .capx so you guys can take a look at it, because I really can't explain what happens to the game in words.

    See, now I'm trying to add another animation to the variable for "action" (formerly "Direction"). When "action" is set to "shooting", the enemies stop and fire in a straight line at the player every couple of seconds, with the animation "Shoot". The problem is that everything is ten kinds of screwy with it and I'm not sure what I did wrong!

    Here is my current code for the enemy (excluding the creation). Things to ignore unless they're relevant: The direction the projectiles go in when the enemy fires & the fact that "shooting" activating doesn't take Y pos into account.

  • Haha, wow, that was a brain fart on my end. I hadn't considered that the sprite wasn't actually connected to the box, I just figured pinning it to the box that created it would be enough! That's what I get for messing with Construct before I have my morning coffee.

    What I did to fix it was, I assigned a global variable called "EnemyID", set to 0 by default. Then I gave the box its own variable (myID_Box) as well as the sprite (myID_Enemy). Then I did the following to assign the numbers:

    And checked that the two values are equal:

    And if the value of the enemy box that hits a GoLeft/GoRight box is equal to that of an enemy sprite, the enemy sprite with the same number flips (which is, of course, true for the sprite attached to it)! Now it works perfectly! Thanks, guys!

    (Searching the tutorial section for this while troubleshooting it was a huge pain in the butt, haha)