Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module PlatformerActor
- open Microsoft.Xna.Framework
- open Microsoft.Xna.Framework.Graphics
- open Microsoft.Xna.Framework.Content
- type BodyType =
- | Static
- | Dynamic of Vector2
- type PlayerState =
- | Nothing
- | Jumping
- type ActorType =
- | Player of PlayerState
- | Obstacle
- type WorldActor =
- {
- ActorType : ActorType;
- Position : Vector2;
- Size : Vector2;
- Texture : Texture2D option;
- BodyType : BodyType
- }
- member this.CurrentBounds
- with get () = Rectangle((int this.Position.X),(int this.Position.Y),(int this.Size.X),(int this.Size.Y))
- member this.DesiredBounds
- with get () = let desiredPos = match this.BodyType with
- | Dynamic(s) -> this.Position + s
- | _-> this.Position
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement