oosyrag's Forum Posts

  • You used a "Move at angle action". This will complete instantly. Instead, use the bullet behavior actions "Set angle of motion" and "set speed", with a timer for duration.

    Since you're already using the bullet behavior for the enemies normal movement, you can either add a second bullet behavior to control the knockback, or disable the normal movement events while the enemy is getting knocked back. Again, the timer behavior will be useful here.

    [quote:9d7aj68z]When the enemy sprite gets hit by the player, set the enemy bullet speed and angle to the desired values.

    You can also utilize the timer behavior to determine when to end the movement. On hit, trigger the timer for the desired duration, and on timer complete set the enemy bullet speed back to 0.

  • In the animations editor, you can save animation frames to disk, and then import them again to your new project, if you don't have the original files anymore. If you have the original files, just import them like you did the first time.

  • Use 2 bullet behaviors. Make sure set angle is not selected for either.

    -> Sprite: Set angle toward (Center.X, Center.Y)

    -> Sprite: Set Bullet angle of motion to Self.Angle degrees

    -> Sprite: Set Bullet speed to distance(Self.X,Self.Y,Center.X,Center.Y)÷2

    -> Sprite: Set Bullet2 angle of motion to Self.Angle+90 degrees

    -> Sprite: Set Bullet2 speed to distance(Self.X,Self.Y,Center.X,Center.Y)×4

    Not sure how you would use physics for it, sorry.

  • Compact version:

    + Bullet: On collision with Block

    -> Block: Set animation frame to Self.AnimationFrame=2?0:Self.AnimationFrame+1

    This is a conditional operator, and basically means "Is self.animationframe currently 2? If yes, set to 0, if no, add 1."

    So every time a bullet collides with a block, the blocks animation frame will go from 0 to 1, 1 to 2, or 2 to 0.

  • Is it possible to clear the storage of a game saved by the System object (-> System: Save game to slot "x")?

    There is no direct way to delete data from a save slot.

    The most straightforward way is to overwrite the slot with a new or fresh game state.

    Normally what you would delete is the reference to that save slot, so users can't pick it anymore. In other words rather than deleting the save slot, you can delete the ability for a user to load a particular save. You do this simply by setting a new slot to save to and load from, and you can overwrite the old one at a later time if you want to save space.

    Or is it possible to save and load the entire game in a LocalStorage as simple as "System: Save game?"

    It is possible, but not simple at all. You'll need to manually determine everything to save and load. Depending on the type of game and how much data needs to be saved, this may not be feasible.

  • All a peer does is send its inputs, the host determines what to do with the inputs.

    The peer doesn't even need to know if it is touching anything. The host will see if there is an object at the location the peer's input specifies. Messages should not be used in this case.

  • To move an object linearly over time, you can utilize the bullet behavior. Your enemy will also have the bullet behavior. The start speed will be 0.

    When the enemy sprite gets hit by the player, set the enemy bullet speed and angle to the desired values.

    You can also utilize the timer behavior to determine when to end the movement. On hit, trigger the timer for the desired duration, and on timer complete set the enemy bullet speed back to 0.

  • Yes this is possible.

    As with all peer to peer networking with authoritative host, each peer will send only their input states to the host, such as mouse position and button inputs.

    The host, upon receiving the input state from any peer, can determine what to do with the object.

    For example, upon receiving a "click" and "position" from a peer, the host will go through the following process:

    Conditions:

    Where did the peer click? Is it on an object?

    Is the peer holding the mouse down?

    Where is the peer's mouse position moving to?

    Action:

    Move object to new location.

    Using object syncing, the object's new position will be reflected to all peers.

    You will have some additional considerations, such as "ownership" of an object, so multiple people can't manipulate the same object simultaneously, as well as local input prediction so the object's movement will be instantly reflected locally on a peer to hide lag.

  • Your performance issue is unlikely to have anything to do with the number of objects. Static off screen objects should basically be negligible in terms of performance.

    It will be difficult to give more advice without seeing the whole situation though.

    Looping through a large array constantly definitely is not a good idea. If you want to stick with that general method, you'll want to break your map and arrays into "cells". A fair cell size would be a bit larger than your viewport window. As you move around your map, you'll only use the 4 (offset based on half cell sizes) or 9 (whole cells, simpler but less efficient) nearest cells/arrays to populate the map. Also generally speaking you probably want to avoid destroying and recreating an object that is going to be exactly the same as it was before anyway, so adding a check to see if the object already exists then not taking action is better.

    Still, I normally wouldn't recommend this technique outside of completely procedural/endless map type games, it should normally not be necessary.

  • Try moving the world around the player instead of moving the player directly.

  • The first idea that came to mind is to have a checkpoint trailing behind the player location. When you use the checkpoint to respawn, disable enemy spawnng for x amount of time, and place x amount of flat ground before starting up your procedural generation again.

  • HTTP headers are configured on the server side, where the file is hosted - in your case, Google Drive.

    The control is specifically there to prevent outside websites or apps (your game) from directly accessing files on the server. It is pretty much on by default for all servers, because the owners of those servers don't want people abusing their resources.

    If you are the owner/admin of your own server, you can set that HTTP header to allow cross domain access in your server configuration.

    Basically, if you want your app to access data online, a free file hosting service probably isn't going to cut it. You might want to look into setting up your own server, or use a service like backendless, firebase, or parse.

  • You can open C2 files directly from C3....

    Here is another https://www.dropbox.com/s/l8ap1sdcf26uf ... e.c3p?dl=0

  • Generally speaking, if you want an event to run for each instance of an object instead of one time for all of them, you want to use the system "for each" condition.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Fake path is what I was thinking. Just a quick idea, I haven't tried this, but if your layouts are generally going to be similar to your example it should work...

    You're going to spawn four invisible helper objects at each wall object , offset at each corner. Whenever you select a destination, your player will pick the nearest helper object that exists between player and destination, and move there. When it arrives, repeat for the next closest helper object between player and destination (the ones that have been passed are no longer considered). Continue until no more helper sprites exist between player and destination. This should get you a very rudimentary pathfinding system.

    There are many situations it might not be ideal though...