austineast / echo-flixel Goto Github PK
View Code? Open in Web Editor NEWA library to integrate echo physics with Haxeflixel!
License: MIT License
A library to integrate echo physics with Haxeflixel!
License: MIT License
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
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 ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.