Tag Info

Hot answers tagged

3

Both of these examples are commonly used because they both have their advantages and drawbacks, mainly on the programming side of things. Square/Restricted Maps Pros: Easy to program, positions can be stored in tile-coordinates as integers and/or in world coordinates. Easy for the player to understand Fast Fairly easy math Cons: Very restricted in ...


1

Here's one very simple way to do it: package; import flixel.FlxG; import flixel.FlxSprite; class Player extends FlxSprite { public static inline var VELOCITY:Float = 4; public function new() { super(); // enforce subpixel-rendering for smoother movement pixelPerfectRender = false; } override public function ...


1

Do you want the objects to move along the X axis (right to left) at the same speed or should this vary? If it should be the same speed, simply apply some sort of random modification to their Y velocity every X frames while keeping the X velocity at a constant. If they should slightly vary in speed from left to right, do the same as above making sure to ...


1

I would suggest making a separate buffer for each player that is responsible for squashing commands together. Basically, it should reduce a set of network packets into an approximation of user's input, which is sampled only once per game update that should result in equally significant change for every player. The question is, what should be sampled from ...


1

Your game shouldn't depend on the speed at which the packets are sent as it will vary depending on your internet connection regardless of what rate you attempt to send them. Instead your server should move the character depending on the user actions (e.g. while they are pressing (sending) W move them forward, or if you are counting mouse clicks then send ...


1

You can use something like this: IEnumerator MoveFromTo(Transform objectToMove, Vector3 a, Vector3 b, float speed) { float step = (speed / (a - b).magnitude) * Time.fixedDeltaTime; float t = 0; while (t <= 1.0f) { t += step; // Goes from 0 to 1, incrementing by step each time objectToMove.position = ...



Only top voted, non community-wiki answers of a minimum length are eligible