diff --git a/cmd/doodad/commands/edit_level.go b/cmd/doodad/commands/edit_level.go index 4d620f1..351914f 100644 --- a/cmd/doodad/commands/edit_level.go +++ b/cmd/doodad/commands/edit_level.go @@ -55,6 +55,10 @@ func init() { Name: "unlock", Usage: "remove the write-lock on the level file", }, + &cli.StringFlag{ + Name: "remove-actor", + Usage: "Remove all instances of the actor from the level. Value is their filename or UUID.", + }, }, Action: func(c *cli.Context) error { if c.NArg() < 1 { @@ -145,6 +149,29 @@ func editLevel(c *cli.Context, filename string) error { modified = true } + if c.String("remove-actor") != "" { + var ( + match = c.String("remove-actor") + removeIDs = []string{} + ) + + for id, actor := range lvl.Actors { + if id == match || actor.Filename == match { + removeIDs = append(removeIDs, id) + } + } + + if len(removeIDs) > 0 { + for _, id := range removeIDs { + delete(lvl.Actors, id) + } + log.Info("Removed %d instances of actor %s from the level.", len(removeIDs), match) + modified = true + } else { + log.Error("Did not find any actors like %s in the level.", match) + } + } + /****************************** * Save level changes to disk * ******************************/ diff --git a/dev-assets/doodads/regions/checkpoint-128.png b/dev-assets/doodads/regions/checkpoint-128.png index bc1c34e..13766e6 100644 Binary files a/dev-assets/doodads/regions/checkpoint-128.png and b/dev-assets/doodads/regions/checkpoint-128.png differ diff --git a/dev-assets/doodads/regions/goal-128.png b/dev-assets/doodads/regions/goal-128.png index b769917..c93dd3c 100644 Binary files a/dev-assets/doodads/regions/goal-128.png and b/dev-assets/doodads/regions/goal-128.png differ diff --git a/dev-assets/doodads/regions/power-64.png b/dev-assets/doodads/regions/power-64.png index cfe47f5..14a743c 100644 Binary files a/dev-assets/doodads/regions/power-64.png and b/dev-assets/doodads/regions/power-64.png differ diff --git a/pkg/balance/numbers.go b/pkg/balance/numbers.go index 6e0aa83..a1cb36b 100644 --- a/pkg/balance/numbers.go +++ b/pkg/balance/numbers.go @@ -24,7 +24,7 @@ var ( // Player speeds PlayerMaxVelocity float64 = 7 - PlayerJumpVelocity float64 = -20 + PlayerJumpVelocity float64 = -23 PlayerAcceleration float64 = 0.12 Gravity float64 = 7 GravityAcceleration float64 = 0.1 diff --git a/pkg/editor_ui.go b/pkg/editor_ui.go index da5ee2e..579fd34 100644 --- a/pkg/editor_ui.go +++ b/pkg/editor_ui.go @@ -470,9 +470,6 @@ func (u *EditorUI) SetupCanvas(d *Doodle) *uix.Canvas { // Was it an already existing actor to re-add to the map? if actor.actor != nil { - actor.actor.Point = position - u.Scene.Level.Actors.Add(actor.actor) - // Was this doodad drop, the Play Level button? if actor.actor.Filename == "__play_from_here__" { if shmem.Cursor.Inside(u.PlayButton.Rect()) { @@ -482,6 +479,9 @@ func (u *EditorUI) SetupCanvas(d *Doodle) *uix.Canvas { } return nil } + + actor.actor.Point = position + u.Scene.Level.Actors.Add(actor.actor) } else { u.Scene.Level.Actors.Add(&level.Actor{ Point: position, diff --git a/pkg/keybind/keybind.go b/pkg/keybind/keybind.go index 907b99c..27ed9b8 100644 --- a/pkg/keybind/keybind.go +++ b/pkg/keybind/keybind.go @@ -151,7 +151,11 @@ func NewLevel(ev *event.State) bool { // Save (Ctrl-S) func Save(ev *event.State) bool { - return ev.Ctrl && ev.KeyDown("s") + var result = ev.Ctrl && ev.KeyDown("s") + if result { + ev.SetKeyDown("s", false) + } + return result } // SaveAs (Shift-Ctrl-S) diff --git a/pkg/play_scene.go b/pkg/play_scene.go index 6f469c2..453d7ff 100644 --- a/pkg/play_scene.go +++ b/pkg/play_scene.go @@ -541,7 +541,6 @@ func (s *PlayScene) movePlayer(ev *event.State) { // Moving left or right? Interpolate their velocity by acceleration. if direction != 0 { if s.playerLastDirection != direction { - log.Error("Changed directions!") velocity.X = 0 }