oosyrag's Forum Posts

  • First to address refactoring and compacting your event structure, my advice is to not worry about it at all unless it becomes a problem and you have performance issues! I know how satisfying it can be to go over your code and make everything more compact and efficient, but often the way you first imagined the logic to work out in your head is how you set it up in the first place, and that will be the easiest to understand and read for you later, while extremely compact code might be difficult to decipher later down the road when you have a lot more to think about.

    That said, the simplest solution is often the best solution, so sometimes if you find your code getting too complicated, it might be a good idea to step back and see where things could be simplified.

    In this case, given that your movement is working properly with each direction and diagonals, I would separate the feet animation code from the keyboard input code. Use a variable to keep track of which direction they are going (1-8) and play the correct animation based on that variable.

    You might be able to save some animation frames by using the "Mirror" action too, but that can introduce some new complications as well so I would leave that for after you get it working the way you want first.

  • Remember that everything on the event sheet is run from top to bottom logically.

    So in this case, maybe your mouse is overlapping Family1, so it changes to crossredot. but it is also not overlapping Pickups1, so it immediately changes to crossgrey, so you never actually see crossredot.

    Using the system condition "Else" would be useful here. You can read about it here https://www.scirra.com/tutorials/292/gu ... t-features

  • Here is the manual entry for gamepad - https://www.scirra.com/manual/143/gamepad

    I think what you are looking for is the following expression:

    [quote:1d48ezpy]Axis(Gamepad, Index)

    Retrieve the current position of an analog joystick on a specific gamepad. Index specifies left analog X and Y or right analog X and Y axes, subject to Key mapping. Axes range from -100 to 100. Axis values within the Analog deadzone are returned as 0.

    So use this to get X and Y values that you can use in the arctangent formula.

  • Off the top of my head I believe the best way to pause is to put everything (except the pause code) on your event sheet in a group, then disable that group to pause. This should stop everything and anything from happening.

  • What is your stick? Is it a controller's analog stick (gamepad object), or did you create a touchscreen analog stick with sprites?

    The formula for getting angle in degrees from coordinates is atan(changeinY/changeinX)

    If you are making your own touch analog stick - compare stick's current position to the origin position to get change in Y and change in X, use the formula to get your angle from origin, and then use Move At Angle.

  • You need to set the angle of the particle effect when your character turns around.

    How are you having your character sprite turn around? If you are using mirror, add an extra action whenever your mirror your character, use Particle: Set Angle - 180-self.angle.

    Or you can use a variable to keep track of which way your character is facing, and change the particle angle whenever that changes.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Add a "System: For Each - Unit A" to your very first condition.

  • Try starting with the basic example. Go to New Project, and look for Example: Touch - Panning.

  • Use the action:

    Move at angle
    Move the object a number of pixels at a given angle in degrees[/code:j92xkjfx]
  • If you are creating the doors dynamically off screen as the screen moves -

    Create variable NextDoor.

    When a door is created, add 1 to NextDoor.

    If NextDoor > 12 - Set NextDoor to 1

  • I was assuming you were saving the JSON format to disk or webstorage/local storage, then using an AJAX Request to load the saved data. Then you can access it with LastData. Also assumed your JSON data came from an array to begin with.

    For reference for your array load question, if you have the ""{"c2array":true,"size":[7,2,1],"data":[[[1286],[885]]... ect" data (JSON format of array data) in GlobalVariable, you can use Array.Load on that GlobalVariable.

    But glad you figured it out anyway!

  • Short answer is yes you can.

    I think you don't need 8-direction or bullet behavior on the cars.

    Try to break down exactly what you want happening to the cars. When you tap, it is going to move right or left a set amount. First start with the movement action, then add the rotation action after.

    It may help to add an Instance Variable for your car to record if the car is currently moving, and if it is moving left or right.

    I've put together a quick example for you, try your best to figure out how it works, and then add the angle change of the car object. It might help to read about expressions - https://www.scirra.com/manual/78/expressions.

    https://www.dropbox.com/s/ttnepv7yyc3yl ... .capx?dl=0

    Good luck with your game! There will be a lot of things to learn about programming but it will get easier with practice.

  • If you are saving an array as JSON, the cleanest way would be to use the Array object's "Load" action to load it back into an array.

  • For basic projects, local web storage is probably the cleanest and simplest.

    However, you seem to be looking at a multiplayer game. What are you using for your backend/login/id? If you make your own server or use a third party one, you should have no problem saving information to that service.

    I haven't explored multiplayer myself lately but I did have https://parse.com/ bookmarked as a resource, except I think that project got shut down. https://www.firebase.com/ seems to be an alternative.