oosyrag's Forum Posts

  • Depending on your data structure, the dictionary object may be worth looking in to as well. You would have an instance of a dictionary for each set of words, and you would be able to use the "For Each Key" and "Has key" conditions to check for matches.

  • Any reason you're not using the 8 direction behavior? It should encompass everything you require. Set acceleration based on your stick axis value.

    If you want to do it yourself, from what I understand from your description, you're mostly doing it correctly. You'll need velocity and acceleration variables per axis (x and y I assume). Your input determines your acceleration. Every tick, your acceleration will be added to your velocity. For caps, you'll be using the max() and min() expressions. Given no input (else condition), you will need to subtract a set amount from velocity (or add, if it is already negative) towards 0, which represents deceleration/friction.

  • https://www.scirra.com/manual/131/common-conditions

    [quote:151ngzje]Pick nearest/furthest

    Pick the instance either nearest or furthest from a given position in the layout.

  • You would have to have each peer send a message with the relevant information to the host, and the host relay that message to peers. Use tags to facilitate logic to decide what gets sent to who.

    Generally speaking, such an approach will not solve your lag problem. On the other hand, if your project is for school only, your host and your peers should all be local, in which case the internet quality doesn't matter at all.

    If you don't have a good understanding of the difference between host, server, and signalling server, recommend going through the multiplayer tutorials again carefully, or you'll have bigger issues than just lag down the line.

  • https://www.scirra.com/manual/126/system-expressions

    [quote:3rssxxyz]CanvasSnapshot

    Contains the resulting image from a Snapshot canvas action after On canvas snapshot has run. (Note this expression is not available immediately after the Snapshot canvas action - you can only use it after On canvas snapshot triggers.) The expression returns a data URI of the image file. This can be loaded in to a Sprite or Tiled Background object via Load image from URL, sent to a server or stored locally, or opened with the Browser object in a new tab to save to disk.

  • You may want to set up custom events for movement and collisions if at all feasible. I've run into this issue before with pixel perfect blocks sliding up against each other where solids did not play nicely. Adjacent pixels count as colliding and solids will block each other.

    Although if anyone has any other ideas I'd be interested as well.

  • You probably have bullets being created every frame, or tick.

    Try adding an Every X Seconds condition to your bullet spawning event, or other condition to limit the rate that event fires.

    Remember the entire event sheet will run once per frame.

  • I think something got misunderstood here.

    This is as described in your image. The indicator is based on the x/y of the projectile, constrained to the viewport bounds. I think this isn't the end effect you are going for though...

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

    If you want an indicator to show where the object is expected to enter the viewport based on angle of motion, you'll need to raycast and see where the ray intercepts the viewport bound and as 99instacesgo suggests. There are ways to do this without plugins as well, but it is an intermediate-advanced task. https://www.scirra.com/tutorials/902/li ... raycasting

  • Generally the safest way is to include your file as a project file in your capx.

    Otherwise you need to have the server your file is located on specifically set up to allow cross domain ajax requests. Which is exactly what the manual entry describes.

  • Check out the vertical space shooter example that comes with C2 too (when you go to new project), most people miss it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So the problem is in event 8 - your peer is creating an object. Multiplayer sync only works from the host's point of view. Whatever is being created on the peer side does not sync to the host.

    The host should be responsible for creating the object when the peer joins. If synced, this will create the object on both the host and the peer. The peer then associates the object created as their own.

    This is described in more detail in the following:

    https://www.scirra.com/tutorials/915/mu ... ame/page-5

    https://www.scirra.com/tutorials/915/mu ... ame/page-6

    Sorry for being preachy, but I'm going to again highly recommend going through all the official multiplayer tutorials. The first one is full of concepts only yes, and it serves as a basis for understanding why the multiplayer plugin was set up the way it is. The following three are step by step tutorials that showcase and explain all the bare minimum building blocks of multiplayer games.

  • There are so many things that can go wrong with a multiplayer game it will be impossible to give you advice without a capx. It would also help if you linked the tutorial you are referencing.

    But first to confirm it's not a routing issue, are you testing locally with multiple browser windows or are you testing across a network?

    Also have you done all the official multiplayer tutorials and understood them? You will find it painfully difficult to progress otherwise.

  • When you export and minify, nothing should be readable.

  • Same thing. Set opacity to sprite.opacity-dt

    If you want to constrain it so it doesn't go negative, you would do max(0,sprite.opacity-dt)

    Alternatively, use the fade behavior.