Git Product home page Git Product logo

echo-flixel's People

Contributors

austineast avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

echo-flixel's Issues

Shift of 1 update when changing the body's rotation

Hello,
I am using Flixel Echo integration to create a simple prototype

I need to change to rotation of a simple rectangular body (which I call "pen") but when I change it, I can see that there is 1 update shift between the rotation I set and what the collision object's rotation is.
It's also strange because the FlxSprite rotation is correclty updated

Also, when my "ball" (a circle body) collide with the pen, the pen body rotation is successfully updated.

Here is a video of what I get. You can see the FlxSprite as a blue rectangle and its body. I have 2 keys to put the rotation from 45 to 90 : https://i.imgur.com/EooXyYW.mp4
(Visual bugs are due to compression, I am sorry)

Here is my Pen class (named Stylo because I am French) :

package;

import echo.Body;
import flixel.FlxSprite;

using echo.FlxEcho;

class Stylo extends FlxSprite
{
	public static inline final BLUE:Int = 0xFF0000FF;
	public static inline final BLACK:Int = 0xFF000000;
	public static inline final GREEN:Int = 0xFF00FF00;
	public static inline final RED:Int = 0xFFFF0000;

	public var body:Body;

	public function new(x:Float, y:Float, color:Int):Void
	{
		super(x, y);

		makeGraphic(500, 30, color);

		this.add_body({
			// kinematic: true,
			mass: 0.000001
			// elasticity: 1
		});

		body = this.get_body();
	}
}

And here is what I have in my update function to change the pen rotation :

if (FlxG.mouse.justPressedMiddle)
{
	styloBleu.get_body().rotation = 45;
}

if (FlxG.mouse.justPressedRight)
{
	styloBleu.get_body().rotation = 90;
}

Thank you

Group of sprites where one acts as the collider and move together

Hi, I've been trying out Echo and I like it so far, though there is one thing that I couldn't find in the demos to see if it's currently doable: I'm trying to create a player that has one central Body that acts as the collider that interacts with the walls, and within itself has a "weapon" collider that interacts only with enemies.

I've tried using FlxSpriteGroup and called "add_body()" on it, and added the weapon sprite to the group and the problem I'm facing now is that the applied velocity to the "central" body doesn't get carried to the inner elements in the FlxSpriteGroup by default, so the weapon just stays in the same place.

Basically what I've need is a traditional hierarchy group, you have the parent to be the collider and the child just follows along.

The "Bodies With Multiple Shapes" demo is kind of near what I'm trying to achieve, but instead the other shapes shouldn't collide but follow along the one that does collide, and ideally they should be sprites instead of bodies.

Do anyone know if this is doable with Echo/Echo-Flixel ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.