WaveEngine Team
@waveengineteam
http://waveengine.net
WaveEngine Components
Component Based Game
Engine
Component types
Componentes
Drawables
Behaviors
2D Components
Components Behavior Drawable
• Transform2D
• Sprite
• SpriteAtlas
• Material2D
• ParticleSystem2D
• Joint2D
...
Entity
To draw a sprite
Transform2D
Sprite
SpriteRenderer
To draw a sprite
Entity sprite = new Entity("mySprite")
.AddComponent(new Transform2D())
.AddComponent(new Sprite("Content...
Transfom2D
.AddComponent(new Transform2D()
{
Origin = Vector2.Center // [0,0] – [1,1]
X = 100, //0 Default
Y = 100, // 0 D...
Sprite
.AddComponent(new Sprite(“Content/texture.wpk”)
{
IsGlobalAsset = true, // Default: False
TintColor = Color.Red, //...
Opaque
Alpha
Additive
GUI
SpriteRenderer
.AddComponent(new SpriteRenderer(DefaultLayers.Opaque))
Debug
To draw a sprite from Atlas
Entity sprite = new Entity("mySprite")
.AddComponent(new Transform2D())
.AddComponent(new Spri...
Simple property animation
var move = new SingleAnimation(0,100, TimeSpan.FromSeconds(2f), EasingFunctions.Back);
PropertyV...
Simple entity animation
Entity sprite = new Entity("mySprite")
.AddComponent(new Transform2D())
.AddComponent(new Animatio...
Collision detection
Collider2D
• RectangleCollider
• CircleCollider
• PerPixelCollider
Collision detection
Entity sprite = new Entity("mySprite")
.AddComponent(new Transform2D())
.AddComponent(new RectangleCol...
To draw an animated character(SpriteSheet)
Texture Packer (SpriteSheet)
http://www.codeandweb.com/texturepacker
To draw an animated character(SpriteSheet)
Entity player= new Entity(“myPlayer")
.AddComponent(new Transform2D())
.AddComp...
To draw an animated character (Skeleton)
To draw an animated character (Skeleton)
http://esotericsoftware.com/
To draw an animated character (Skeleton)
Entity player = new Entity(“myPlayer")
.AddComponent(new Transform2D())
.AddCompo...
2D Particle system
2D Particle system
Entity smokeParticles= new Entity(“myPlayer")
.AddComponent(new Transform2D())
.AddComponent(new Partic...
2D Particle system
.AddComponent(new ParticleSystem2D()
{ //Parameters
NumParticles = 100,
EmitRate = 1500,
MinLife = Time...
2D physics components
• WaveEngine integrates the Box2D implementation in C# called
FarseerPhysics.
• Offers a component b...
2D physics components
Entity sprite = new Entity("mySprite")
.AddComponent(new Transform2D())
.AddComponent(new RectangleC...
2D physics components
.AddComponent(new RigidBody2D()
{ //Parameters
Mass = 4f, // Default: 2f
Friction = 1f, // Default: ...
2D physics components
Joint2D
• AngleJoint2D
• DistanceJoint2D
• FixedJoint
• FixedMouseJoint2D
• PrismaticJoint2D
• Revol...
UI Components
UIBase
• Button
• CheckBox
• Grid
• Image
• Panel
• ProgressBar
• RadioButton
• Slider
• Stack
• TextBlock
•...
Thank you
WaveEngine Team
@waveengineteam
http://waveengine.net
Upcoming SlideShare
Loading in …5
×

WaveEngine 2D components

3,571 views

Published on

Review of the WaveEngine 2D components

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,571
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
79
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

WaveEngine 2D components

  1. 1. WaveEngine Team @waveengineteam http://waveengine.net WaveEngine Components
  2. 2. Component Based Game Engine
  3. 3. Component types Componentes Drawables Behaviors
  4. 4. 2D Components Components Behavior Drawable • Transform2D • Sprite • SpriteAtlas • Material2D • ParticleSystem2D • Joint2D • TouchGestures • SkeletalAnimation • Animation2D • AnimationUI • Collider2D • RigidBody2D • SpriteRenderer • SpriteAtlasRenderer • QuadRenderer • AnimatedSpriteRenderer • ParticleSystemRenderer2d
  5. 5. Entity To draw a sprite Transform2D Sprite SpriteRenderer
  6. 6. To draw a sprite Entity sprite = new Entity("mySprite") .AddComponent(new Transform2D()) .AddComponent(new Sprite("Content/texture.wpk")) .AddComponent(new SpriteRenderer(DefaultLayers.Opaque)); EntityManager.Add(sprite);
  7. 7. Transfom2D .AddComponent(new Transform2D() { Origin = Vector2.Center // [0,0] – [1,1] X = 100, //0 Default Y = 100, // 0 Default XScale = 1.5f, // 1 Default YScale = 1.5f, // 1 Default Rotation = Math.PI, // 0 Default Opacity = 0.6f, // [0-1] 0 Alpha, 1 Opaque (default) DrawOrder = 0.3f, //[0-1] 0 Front, 1 Back Default:0.5f })
  8. 8. Sprite .AddComponent(new Sprite(“Content/texture.wpk”) { IsGlobalAsset = true, // Default: False TintColor = Color.Red, //Default Color.White SourceRectangle = new Rectangle(0, 0, 100, 100); })
  9. 9. Opaque Alpha Additive GUI SpriteRenderer .AddComponent(new SpriteRenderer(DefaultLayers.Opaque)) Debug
  10. 10. To draw a sprite from Atlas Entity sprite = new Entity("mySprite") .AddComponent(new Transform2D()) .AddComponent(new SpriteAtlas("Content/atlas.wpk", “textureInAtlas”)) .AddComponent(new SpriteAtlasRenderer(DefaultLayers.Opaque)); EntityManager.Add(sprite);
  11. 11. Simple property animation var move = new SingleAnimation(0,100, TimeSpan.FromSeconds(2f), EasingFunctions.Back); PropertyValue = 0 PropertyValue = 100 2 seconds
  12. 12. Simple entity animation Entity sprite = new Entity("mySprite") .AddComponent(new Transform2D()) .AddComponent(new AnimationUI()) .AddComponent(new Sprite("Content/texture.wpk")) .AddComponent(new SpriteRenderer(DefaultLayers.Opaque)); EntityManager.Add(sprite); AnimationUI animation = sprite.FindComponent<AnimationUI>(); animation.BeginAnimation(Transform2D.XProperty, move);
  13. 13. Collision detection Collider2D • RectangleCollider • CircleCollider • PerPixelCollider
  14. 14. Collision detection Entity sprite = new Entity("mySprite") .AddComponent(new Transform2D()) .AddComponent(new RectangleCollider()) .AddComponent(new Sprite("Content/texture.wpk")) .AddComponent(new SpriteRenderer(DefaultLayers.Opaque)); EntityManager.Add(sprite); Collider2D collider = sprite.FindComponent<RectangleCollider>(); collider.Intersects(otherCollider);
  15. 15. To draw an animated character(SpriteSheet)
  16. 16. Texture Packer (SpriteSheet) http://www.codeandweb.com/texturepacker
  17. 17. To draw an animated character(SpriteSheet) Entity player= new Entity(“myPlayer") .AddComponent(new Transform2D()) .AddComponent(new Sprite("Content/spriteSheet.wpk")) .AddComponent(Animation2D.Create<TexturePackerGenericXml>(“Content/spriteSheet.xml") .Add("idle", new SpriteSheetAnimationSequence() { First = 1, Length = 8})) .Add("run", new SpriteSheetAnimationSequence() { First = 9, Length = 8})) .AddComponent(new AnimatedSpriteRenderer(DefaultLayers.Opaque)); EntityManager.Add(player);
  18. 18. To draw an animated character (Skeleton)
  19. 19. To draw an animated character (Skeleton) http://esotericsoftware.com/
  20. 20. To draw an animated character (Skeleton) Entity player = new Entity(“myPlayer") .AddComponent(new Transform2D()) .AddComponent(new SkeletalData("Content/spriteSheet.atlas")) .AddComponent(new SkeletalAnimation("Content/spriteSheet.json")) .AddComponent(new SkeletalRenderer()); EntityManager.Add(player);
  21. 21. 2D Particle system
  22. 22. 2D Particle system Entity smokeParticles= new Entity(“myPlayer") .AddComponent(new Transform2D()) .AddComponent(new ParticleSystem2D() { //Parameters }) .AddComponent(new Material2D(new BasicMaterial2D("Content/particleTexture.wpk"))) .AddComponent(new ParticleSystemRenderer2D(“smoke", DefaultLayers.Alpha)); EntityManager.Add(smokeParticles);
  23. 23. 2D Particle system .AddComponent(new ParticleSystem2D() { //Parameters NumParticles = 100, EmitRate = 1500, MinLife = TimeSpan.FromSeconds(1f), MaxLife = TimeSpan.FromSeconds(3f), LocalVelocity = new Vector2(0f, 0f), RandomVelocity = new Vector2(3f, 2.5f), MinSize = 15, MaxSize = 40, MinRotateSpeed = 0.03f, MaxRotateSpeed = -0.03f, EndDeltaScale = 0f, EmitterSize = new Vector2(30), Gravity = new Vector2(0, 0.03f), EmitterShape = ParticleSystem2D.Shape.FillCircle, Emit = false, })
  24. 24. 2D physics components • WaveEngine integrates the Box2D implementation in C# called FarseerPhysics. • Offers a component based interface • Not all Box2D feature are available in the current version, but the most important ones are.
  25. 25. 2D physics components Entity sprite = new Entity("mySprite") .AddComponent(new Transform2D()) .AddComponent(new RectangleCollider()) .AddComponent(new RigidBody2D() { //Parameters}) .AddComponent(new Sprite("Content/texture.wpk")) .AddComponent(new SpriteRenderer(DefaultLayers.Opaque)); EntityManager.Add(sprite);
  26. 26. 2D physics components .AddComponent(new RigidBody2D() { //Parameters Mass = 4f, // Default: 2f Friction = 1f, // Default: 0.5f Damping = 0.8f, // Default: 0.4f Restitution = 0.5f, // Default: 0.3f CollisionCategories = Physic2DCategory.Cat1, CollidesWith = Physic2DCategory.Cat2, IsKinematic = true, // Default: false })
  27. 27. 2D physics components Joint2D • AngleJoint2D • DistanceJoint2D • FixedJoint • FixedMouseJoint2D • PrismaticJoint2D • RevoluteJoint2D
  28. 28. UI Components UIBase • Button • CheckBox • Grid • Image • Panel • ProgressBar • RadioButton • Slider • Stack • TextBlock • TextBox • ToggleSwitch • Wrap
  29. 29. Thank you WaveEngine Team @waveengineteam http://waveengine.net

×