You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A user tweeted me about add-ons and requests. He put the source at dropbox and he also made two videos which he shows examples and explains requests. The spare you guys time, I’ll put the summary here. URL: https://t.co/HJJ750ikqj
When he says "you", he actually means me. His video message was targeted to me.
He extended FlxTilemap and rewrote some parts of the overlap functions. It only works on 45 degrees, but it shouldn’t be too hard to support other degrees as well. This could be very handy if you want to stay at QuadTree algorithm.
I have plans to use Ninja algorithm from Phaser which is tiny and got a lot of different collisions possibility.
URL: https://github.com/photonstorm/phaser/tree/master/src/physics/ninja
FlxU WrapAngle
When an object keeps spinning the angle keeps increasing. With this method you can reset to the correct angle with a number between -180 and +180. I’ve use this in Box2D B2FlxSprite before.
The angle in FlxSprite won’t reset if you keep it rotated, it could be used in here.
FlxU AngleLimit
Don’t let the object rotate to the min or max degree.
FlxU MakeRandom
Generate a random int between min and max. It uses Random from Java API.
A dice makeRandom(1, 6).
This is actually the same as (int)(6.0*FlxG.random() + 1.0). We could use his method, but without the Random class.
FlxText TypeWriterEffect
It shows a char one by one depending on the speed you’ve set. This is very common in games.
Request - FlxGroup with type
Now we got FlxGroup::members array that holds FlxBasic. You need to cast every object into your object. Change this into:
FlxGroup<TextendsFlxBasic> extendsFlxBasicmembers<TextendsFlxBasic>
newFlxGroup<FlxBasic>(); // defaultnewFlxGroup<EnemyAbstract>();
group.getFirstAlive().attack(); // an enemy method without casting
A lot needs to be changed to get things back working again. I haven’t taken a look how to deal with reflection part though.
Request Spritesheet
I’ve relisted the request twice and still I have no clue what he is saying.
This part is not relevant for the most of you. It’s about Tiled + Box2D support. He made a lot of classes to make this to work which wasn’t needed if he had used the latest version of FlxBox2D. The reason why he worked on Tiled + Box2D is to support slopes, but now he figured this out with QuadTree this is not needed.
But I’m doing him a fever to answer all his problems, because he made a video for me.
Follow and deadzone
This works if you run the example with the Cart. It will follow the object.
SpriteCache
Render sprites that are only static, which means no rotation, coloring, skewing, etc. This improves performance. Could be handy only if the benchmark says it’s worth it.
Lines from Tiled and convert to Box2D
If you know the coordinates then you can easily convert this to a box2d object without writing addition classes. Even creating slopes would be easy.
Other editors.
A friend of Emanuel uses RubeLoader to create levels in Box2D, which is better suited than Tiled. There is another editor for Windows only, but I forgot the name.
Sorry pal, I won’t use your TiFlx classes. You should have use the latest version.
What do you guys think?
The text was updated successfully, but these errors were encountered:
Lines from Tiled can be converted to FlxSprites as well! The Request Spritesheet refers to the possibility of using animations both from column and rows like :
If you have any new classes in mind that you want to add,give me a message and i`ll try to implement them!
Hi guys,
A user tweeted me about add-ons and requests. He put the source at dropbox and he also made two videos which he shows examples and explains requests. The spare you guys time, I’ll put the summary here. URL: https://t.co/HJJ750ikqj
When he says "you", he actually means me. His video message was targeted to me.
Video #1
Slopes 45 degrees
He extended FlxTilemap and rewrote some parts of the overlap functions. It only works on 45 degrees, but it shouldn’t be too hard to support other degrees as well. This could be very handy if you want to stay at QuadTree algorithm.
I have plans to use Ninja algorithm from Phaser which is tiny and got a lot of different collisions possibility.
URL: https://github.com/photonstorm/phaser/tree/master/src/physics/ninja
FlxU WrapAngle
When an object keeps spinning the angle keeps increasing. With this method you can reset to the correct angle with a number between -180 and +180. I’ve use this in Box2D B2FlxSprite before.
The angle in FlxSprite won’t reset if you keep it rotated, it could be used in here.
FlxU AngleLimit
Don’t let the object rotate to the min or max degree.
FlxU MakeRandom
Generate a random int between min and max. It uses Random from Java API.
A dice
makeRandom(1, 6)
.This is actually the same as
(int)(6.0*FlxG.random() + 1.0)
. We could use his method, but without the Random class.FlxText TypeWriterEffect
It shows a char one by one depending on the speed you’ve set. This is very common in games.
Request - FlxGroup with type
Now we got FlxGroup::members array that holds FlxBasic. You need to cast every object into your object. Change this into:
A lot needs to be changed to get things back working again. I haven’t taken a look how to deal with reflection part though.
Request Spritesheet
I’ve relisted the request twice and still I have no clue what he is saying.
Video #2
This part is not relevant for the most of you. It’s about Tiled + Box2D support. He made a lot of classes to make this to work which wasn’t needed if he had used the latest version of FlxBox2D. The reason why he worked on Tiled + Box2D is to support slopes, but now he figured this out with QuadTree this is not needed.
But I’m doing him a fever to answer all his problems, because he made a video for me.
Follow and deadzone
This works if you run the example with the Cart. It will follow the object.
SpriteCache
Render sprites that are only static, which means no rotation, coloring, skewing, etc. This improves performance. Could be handy only if the benchmark says it’s worth it.
Lines from Tiled and convert to Box2D
If you know the coordinates then you can easily convert this to a box2d object without writing addition classes. Even creating slopes would be easy.
Other editors.
A friend of Emanuel uses RubeLoader to create levels in Box2D, which is better suited than Tiled. There is another editor for Windows only, but I forgot the name.
Sorry pal, I won’t use your TiFlx classes. You should have use the latest version.
What do you guys think?
The text was updated successfully, but these errors were encountered: