oosyrag's Forum Posts

  • I have no idea what you want it to look like.

    Generally if you want it to look good, as in traditional animation, the entire swing should be drawn out frame by frame and collision boxes applied per frame as an animation, rather than moving and rotating a static sprite.

  • The exact way to achieve what you asked is to store the mouse x/y values in a variable every tick, and compare the current location of the mouse vs the stored value as a condition before updating the variables with the new values.

    This won't be much different than every tick though.

    A more efficient method would be to have an update event run with the mouse button is down and every x seconds conditions.

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

    A rough draft. You'll have a lot of tweaking to do with the angle of motion to get it to how you like. You may want to try using an imagepoint on the sword rather than the player origin to base your angle off of. Also the speed and acceleration (deceleration in this case) can be tweaked as well to get the type of motion you want. A more complicated formula will get you the rapid decay or "eased out" motion as used in Zelda.

    Tebbo - Angle=Angle+180 would be inverted angle, variable=constant-variable gives you invertable values. Unless you had something else in mind for inverse()?

  • You may be overthinking it - try this https://www.dropbox.com/s/urj0lhkonwuix ... .capx?dl=0

    Cooldown system can be added separately, but in the example the sword sprite simply cannot be spawned if one already exists.

  • It works fine if you change it to On touched Sprite.

    Your project has a few other problems though:

    Your hammer position is set to touch.x, touch.y, which is always the first touch's position. You'll want that to be Touch.XAt(Touch.TouchCount-1) and Touch.YAt(Touch.TouchCount-1) to set it to the position of the LAST touched position.

    Also you are using Trigger once improperly. It should not be in a subevent. This can cause your event to break in certain cases, where the health can keep going below 0 and the sprite can never get destroyed again as the event will never run again.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • loopindex*4

    instead of loopindex...

  • I'm not familiar with this topic myself, but Spriter may have the functionality you need.

    https://brashmonkey.com/

  • Access to your javascript file is denied. This is a web host/server setting. Is javascript enabled on your host?

    https://www.scirra.com/manual/168/mime-types

  • Simple, don't use the "tap" guessture, and instead use "is touching object" or "on touched object" instead.

  • 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.