Skip to content

Commit

Permalink
adding push observable after fighting macbook to build the content pi…
Browse files Browse the repository at this point in the history
…peline
  • Loading branch information
bentles committed Oct 28, 2023
1 parent 6238018 commit afb3a77
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 27 deletions.
2 changes: 2 additions & 0 deletions LearningMono/Config/EntityConfig.fs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ let idImage =
Offset = Vector2(0f, 10f) }

let mergeImage = { idImage with TextureName = "merge" }
let pushImage = { idImage with TextureName = "push" }
let compareImage = { idImage with TextureName = "compare" }
let mapImage = { idImage with TextureName = "map" }
let filterImage = { idImage with TextureName = "filter" }
Expand Down Expand Up @@ -73,6 +74,7 @@ let idConfig =
FrameLength = 300L }

let idSpriteConfig = SingleSpriteConfig idConfig
let pushSpriteConfig = SingleSpriteConfig { idConfig with Image = pushImage }
let mergeSpriteConfig = SingleSpriteConfig { idConfig with Image = mergeImage }
let compareSpriteConfig = SingleSpriteConfig { idConfig with Image = compareImage }
let mapSpriteConfig = SingleSpriteConfig { idConfig with Image = mapImage }
Expand Down
12 changes: 12 additions & 0 deletions LearningMono/Content/Content.mgcb
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,18 @@
/processorParam:TextureFormat=Color
/build:sprites/entity/NextLevel.png

#begin sprites/entity/Push.png
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyColor=255,0,255,255
/processorParam:ColorKeyEnabled=True
/processorParam:GenerateMipmaps=False
/processorParam:PremultiplyAlpha=True
/processorParam:ResizeToPowerOfTwo=False
/processorParam:MakeSquare=False
/processorParam:TextureFormat=Color
/build:sprites/entity/Push.png

#begin sprites/entity/Rock.png
/importer:TextureImporter
/processor:TextureProcessor
Expand Down
1 change: 1 addition & 0 deletions LearningMono/Content/sprites/entity/Push.piskel
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"modelVersion":2,"piskel":{"name":"Push","description":"","fps":12,"height":200,"width":50,"layers":["{\"name\":\"Layer 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VSKvFzx0gYIBDZJUCUsIxipnmNhAGCmallAuw1Z8QNEHDES6uSCrpU0FH7Z+HzVNBJtSiFgRZPM1cHiT0qnJBAuIGzvtUFP8wZCQeEKxjY7ItnVIpJJRybAUl1EPrMoZuP6YX5dFsYIFTRp4IORchMZUoxId1+mwnPpN2vWyBSnZZ1i0LptlJBR9WM1nOKCViH/B0raYppAQA7GkDAVt6zK7NTfM+u7IetubvSotiGUsl6MqIUSDUzyYhaKJUM3RUjebIrZQ2nL1z97WlX4poS4dmkWXR4Gcr+OVpVJroV1eC66B5IGAlH90DCyJzCAAlX7ACo+11LuT35b24zvZY2oASiHdFae2JGYEGHTeNsW5+/4lqbItL51cIzrlBA6ph0fDUQ6YLW483VQdYAwH4CaRVp7jrmjFjf6jZLrXBAUkGHisRMi8I9GFMd1JqRMMKzMECogytrpFWNUEy4FZ6lgu6ZOu3P5FJyp1TQUTWj9ZxignNTmt+g02ID2akWnoURDBgFWNdsGC3KP2qRZRRO4/AvAAAAAElFTkSuQmCC\"}]}"]}}
Binary file added LearningMono/Content/sprites/entity/Push.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions LearningMono/Entity.fs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ and ObservableType =
| GoToNextLevel
| Toggle of bool
// | MultiToggle of bool
| Push
| Map of EntityType
| Filter of EntityType
| Compare
Expand Down Expand Up @@ -90,6 +91,7 @@ let getSpriteConfig (eType: EntityType) : SpriteConfig =
match ob with
| GoToNextLevel _ -> nextLevelSpriteConfig
| Id -> idSpriteConfig
| Push -> pushSpriteConfig
| Toggle true -> toggleOnSpriteConfig
| Toggle false -> toggleOffSpriteConfig
| Map _ -> mapSpriteConfig
Expand All @@ -112,6 +114,7 @@ let getEmitImage (eType: EntityType) =
| GoToNextLevel _ -> nextLevelImage
| Toggle _ -> toggleOnImage
| Id -> idImage
| Push -> pushImage
| Map _ -> mapImage
| Merge -> mergeImage
| Filter _ -> filterImage
Expand Down Expand Up @@ -208,6 +211,7 @@ let private behaviorFunc (observable: ObservableData) (a: EntityType voption) (b
match observable.Type with
| Id
| GoToNextLevel
| Push
| Toggle _ ->
match a with
| (ValueSome e1) -> WillEmit e1
Expand Down
54 changes: 27 additions & 27 deletions LearningMono/Levels.fs
Original file line number Diff line number Diff line change
Expand Up @@ -826,14 +826,14 @@ let levelSandBox: LevelBuilder =
createEntityOn
(buildBox
{ Items =
[ (observing (Compare))
(observing (Compare))
(observing (Compare))
(observing (Compare))
(observing (Compare))
(observing (Compare))
(observing (Compare))
(observing (Compare)) ]
[ (observing (Push))
(observing (Push))
(observing (Push))
(observing (Push))
(observing (Push))
(observing (Push))
(observing (Push))
(observing (Push)) ]
IsOpen = false })
Grass
time
Expand Down Expand Up @@ -863,23 +863,23 @@ let levelSandBox: LevelBuilder =

let levels: LevelBuilder[] =
[|
level_playerMoves
level_playerPickUp
level_left
level_dangRocks
level_observers
level_observers2
level_observers3
level_observers4
level_observers5
level_box0
level_box1
level_box2
level_toggles
level_toggles2
level_merge1
//level_merge2
level_filter1
level_filter11
level_filter2
// level_playerMoves
// level_playerPickUp
// level_left
// level_dangRocks
// level_observers
// level_observers2
// level_observers3
// level_observers4
// level_observers5
// level_box0
// level_box1
// level_box2
// level_toggles
// level_toggles2
// level_merge1
// //level_merge2
// level_filter1
// level_filter11
// level_filter2
levelSandBox |]
1 change: 1 addition & 0 deletions LearningMono/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ let main _ =
PipelineTexture("smallChar", "./content/sprites/entity/SmallChar")
PipelineTexture("rock", "./content/sprites/entity/Rock")
PipelineTexture("id", "./content/sprites/entity/Id")
PipelineTexture("push", "./content/sprites/entity/Push")
PipelineTexture("map", "./content/sprites/entity/Map")
PipelineTexture("filter", "./content/sprites/entity/Filter")
PipelineTexture("timer", "./content/sprites/entity/Timer")
Expand Down

0 comments on commit afb3a77

Please sign in to comment.