AlexSV's Forum Posts

  • If you're using bullets for enemies, couldn't you use the solid behavior on the enemies to keep them from overlapping?

  • That is a lot of work on my end and it won't help you learn!

    Look, start with something small.

    Try making an AI that will move towards you or away from you. Use a timer and a random number inside of an instance variable to set AI patterns for your AI.

    Give it a try on your own before you read the next part here. I'll explain it, but you should try at least to figure it out on your own.

    You can do it like this.

    On start of layout -> Start AI Fighter "Random Picker" timer, regular 2 seconds.

    This starts a timer on our AI fighter when the layout begins. This timer repeats because it's regular.

    On "Random Picker" Timer -> set AI_Fighter "Behavior" number to int(random(3))

    Random will set the number randomly between 0 and 1 less than the number you put in, so in this case, randomly from 0 to 2. The int part rounds the number to a whole number. That means it can be 0, 1, or 2.

    Now, make your code do this.

    If "Behavior" is 0, don't simulate control.

    If "Behavior" is 1, simulate control left.

    If "Behavior" is 2, simulate control right.

    This will make an AI that sits still or moves left or right ever 2 seconds.

  • Oh, did you try Layout Scale like peter568 mentioned up above?

  • Well, essentially you have everything you need. Basically, when you are not right clicking, it does the zoom between two objects. When you are right clicking, it only zooms to the crosshair.

    If you're doing the "scroll to" method, you can just set the behavior disabled on the player while you are right clicking and enabled when you aren't.

  • Here, I grabbed some quick screenshots from my own code.

    Ok, so I have a sprite with the solid behavior. I go to that behavior and add a tag, like this. This is done in the properties bar of whatever you added solid to. It could be a sprite, tilemap, tiled background, whatever you need. I tagged my solid "house" in my project.

    Then, we write a piece of code that sets our exceptions for us. In this screenshot, I wanted my player to be able to walk through the house solid, and so I create an action from my player using "set solid collision filter". This action lets you include or exclude, and since I want my player to pass through, I picked "exclude".

    Now my player can walk through any solid tagged as "house".

  • Good to hear! You were destroying the coin as soon as you made it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Right, but if you are holding a button down to move? shouldn't you face that way?

    OK, let me ask a different way. You are using the word "automatically", but I still don't know whaf is making you turn around.

    Are you facing an enemy? Are you looking at the mouse? I don't know what automatic thing you want to do. At this moment I only see that you want to face a direction when you try to move, which is what you're doing already, unless you are using default controls on your player by accident and the code doesn't work. Maybe check and see if default controls are turned on in the behavior?

  • Ok, so looking at the gameplay of the video, I think a simple way to do this might be to do the following...

    Make a crosshair sprite and use "every tick" to set the crosshair at mouse.x and mouse.y.

    Then, add the "scroll-to" behavior to both the player and the crosshair.

    What "scroll-to" does is attempt to center the viewpoint on whatever object it has on it. If you add "scroll-to" to multiple objects, it does a quick version of what oosyrag has described. However, using Scroll To like this means that you can't do little cutscenes where the camera focuses on another object.

    Although oosyrag's version is a bit more complicated, you can do more things with it once you know how.

  • The way you have your code set up to mirror and unmirror the sprite looks correct. That's the way I teach my students to do it. I don't think I quite understand what you're asking.

  • Allrighty then! I appreciate it, depending on the complexity of a room either sprites or cubes will probably build out my areas. Much appreciated!

  • Now you're getting it!

    The animations at the bottom should only happen if "Attacking" is false. That way, when you press your attack button and "Attacking" becomes true, the correct animation will play.

  • And it IS changing to the attack animation. But then right after, because you have other animations at the bottom immediately change it back.

  • On your player, add a new instance variable. Make it a boolean named "Attacking".

    Then, when you want it on, you can use the "set boolean" action.

  • Code executes from top to bottom. Look later in your code, you change the animation again if you aren't moving. This means that you are indeed doing the animation, but then you immediately change it to something else.

    Try adding a boolean variable to your player called "Attacking". When you start the attack, turn "Attacking" on, and when your attack finishes, turn "Attacking" off.

    Then, at the bottom, make your idle animation happen if the player is not moving AND if the player is not attacking.

  • This is a pretty complicated idea to try to tackle, but I figure I can take a small shot at it. The short answer is that you're going to have to figure it out on your own, but I can provide a few examples to get you started.

    Ok, so when you're creating AI, you need your AI to be able to sense things. For example, I once created an enemy that would duck if it sensed oncoming player bullets. I did this with the "is overlapping at offset" condition. I also changed my condition from an "AND" condition to an "OR" condition and made it check both the left and right side of the enemy. Then, when my player shot at the enemy on either side, the enemy would "sense" the oncoming bullet and duck. The trick in that instance was that if the player got very close, the enemy couldn't duck fast enough.

    When you do attacks, you can make your code set boolean variables on the player. So while the player is doing a high punch, you might have a variable on your player called "highAttack". When the attack is finished, turn "highAttack" off. This would let you send information to your AI that a high attack is happening and they then could have a chance to block it. This is also how I make my character stop moving when I do attacks in some of my games, and it works that way in Street Fighter as well. If you have any of your attacking variables on, you can set your code to not allow the player to move.

    Lastly, since you're making a street fighter game, you are probably using the Platform behavior. Behaviors let you do certain conditions, and for platform, you can check if the player is on the floor or not. This is useful for things like jumping attacks.

    Does this help you at all? I hope so!