Ginger Root's Forum Posts

  • 15 posts
  • Anyone? Also, I do indeed have it set to "once while true," and it still doesn't work.

  • http://www.mediafire.com/download/238v7 ... oject.capx

    Controls are:

    Z - JUMP

    X - ATTACK

    D - DASH

    NOTE: You can only attack to the right and be attacked from left for right now. I haven't coded in the other directions.

    1) If the player holds jump while taking damage from the enemy (you have to wait for his attack animation to be damaged by him), they go flying up to space.

    2) If the player hits the attack button right before the damage registers, they're locked into the damage animation and will stay that way until they dash. Again, if you look under the player's event sheet, it's set so that they're locked into the attacking animation until it finishes (with the exception of using the dash), so that seems the obvious culprit. However, I can't figure out how to make it so that while the player is damaged, they can't attack. edit: figured this one out. Just needed to add a variable that says "attacking" is false while the player is hurt.

    3) What's the best way to handle melee combat in a situation like this? Right now I have it so that a collision box is spawned over the player's weapon when they attack, and then if the enemy is overlapping with that box, the enemy is damaged. Is there a better way to go about this? Doing it this way, for some reason the enemy will sometimes be damaged twice even though I only hit the attack button once.

    Thanks in advance!

  • Figured it out. The problem was I needed another condition for when the character's idle animations play after stopping a dash that says attacking is false. While I'm here though, I have another problem! If you hold the dash button while you're in the air, it executes automatically when you land on the ground as long as it's held. I want it to be so that you have to push the button after landing to initiate the dash. Thanks in advance!

  • Hi,

    https://www.dropbox.com/s/4abm8vswatwz1ke/testing.capx?dl=0

    or if the above link doesn't work,

    http://www.mediafire.com/download/c2g56p4ipr5cm32/testing.capx

    There's my current project.

    Z - JUMP

    X - ATTACK

    D - DASH

    To replicate this bug, hold D to dash until it completely stops on its own, then try attacking with X. The character freezes! Now, if you look under the player's mechanics in the code, "start ignoring input" is the obvious culprit. But, I have it set so when the attacking animation is finished, the player should regain control. However, the problem is, if you complete a full dash, that animation won't play at all and the player will just be stuck there until they dash again.

    NOTE: My idea is to have attack animations able to be cancelled by dashing and nothing else. Otherwise, I want the player to be locked into their attack animation until it's finished. What am I doing wrong here? Thanks in advance!

  • Okay, so I have it *kinda* working. I have a timer going that when it reaches a certain amount, the player goes back to their normal speed. The problem is, if the player just keeps holding D, they'll keep dashing (because the conditions for the dash are that the counter is less than "45" and that D is being held down). The timer resets after it reaches 45 and the player is still holding D, so they'll automatically be dashing again. What I can't figure out is how to make it so that the player has to hit the button again to restart the dash. Is there a way to simulate a key being released? Thanks!

  • Thanks! Any other suggestions from those very familiar with Mega Man X?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here's my code so far:

    http://imgur.com/1SYK3lo

    Basically, as long as D is held, the player automatically moves right at a higher speed. If D is not held, the speed returns to normal (180). This works well so far.

    The problem is, I need the dash to last only a certain amount of time before the player has to reinitiate the dash move. If you've played Mega Man X, you'll understand what I mean. When you hold the button, X dashes forward by a certain distance before he stops and you have to do it again. He also stops short if you release the button before that time. Thanks in advance!

  • For reference, how would I handle this if I want the player to retain their control without allowing them to move so quickly during the recoil?

  • I want the player to recoil when they're damaged by the enemy. The best way I can see to do this is on collision with the enemy, set vector x to whichever direction. The problem is I want the player to recoil faster than that. If I change the player's max speed and then set vector x, this seems to work, but then the player is able to move very quickly during that time. What is the best way to go about bouncing the player back?

  • I want to create a way for the player to teleport a certain distance, which is simple enough. The issue arises when there's a wall in the way. I want to check for a wall before the teleport happens so that it won't work if the player will get trapped in there. Additionally, if the wall is low enough (such as a small raised platform), I want the player to teleport to the top of it rather than inside of it. If the wall is too high, nothing will happen.

    I suppose the basic question is how do I check whether or not a wall is in a certain proximity to the player? If the wall is there, the teleport should be disabled, unless it's a relatively short height.

    Additionally I'd like to be able to check whether there is a floor where the player teleports (if there isn't a floor where the teleported player would land, it should not work there).

    If you've ever played MapleStory, certain characters have teleport which is almost precisely what I'm looking to do. The chief bandit's assaulter skill is also really close to what I intend to do. Thanks in advance for any help!

  • The short of it is, the player has an attack box sprite that's called when they hit a button. The event is set so that if the attack box collides with the enemy, the enemy loses a point from its health variable. Then I have a separate event where, if the health variable is less than or equal to 0, the enemy is knocked back, spawns some explosion sprites and then is destroyed.

  • How do I go about picking just the instance that I attacked?

  • Hi, I wanna have only a specific instance of an enemy object destroyed when the player attacks it (obviously, only the instance that was attacked). When I attack, every instance of my enemy is destroyed. The same applies when I have the enemy touch an object that makes it jump (all instances of the enemy jump, even the ones that didn't touch the object). Thanks in advance for any help

  • Any tutorials on containers? I'm not sure at all what that is. Thanks!

  • Basically I have a hit box for my enemy and a separate sprite whose position is set to that box on every tick to represent it (I'm under the impression that it's better practice to do this for collision than to use the actual sprite).

    So, when the enemy is attacked, I switch an instance variable ("dead") from 0 to 1. Then I have a separate event that runs when the dead variable is 1 (true) to animate the enemy exploding and that destroys both the enemy hit box and the sprite that represents it.

    The problem is when I have multiple instances of the enemy, if one of them is attacked, all of them are triggered to die. Do I need separate variables for every instance? How do I do this without creating a big series of events for every single instance of an enemy? Should I not even be using a variable?

    Thanks in advance for any help!

  • 15 posts