• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Go で書き直した Ikemen


Commit MetaInfo

Revisiond20c9853a03b3c0a088e7d03b119d8761835d523 (tree)
Zeit2019-01-26 09:28:26
Autorsuehiro <supersuehiro@user...>
Commitersuehiro

Log Message

さっきの修正では全く直っていなかった

Ändern Zusammenfassung

Diff

--- a/src/camera.go
+++ b/src/camera.go
@@ -82,9 +82,14 @@ func (c *Camera) Update(scl, x, y float32) {
8282 c.Pos[0] = x
8383 c.Pos[1] = y
8484 }
85-func (c *Camera) ScaleBound(scl float32) float32 {
85+func (c *Camera) ScaleBound(scl, sclmul float32) float32 {
8686 if c.ZoomEnable {
87- return MaxF(c.MinScale, MinF(c.ZoomMax, scl))
87+ if sys.debugPaused() {
88+ sclmul = 1
89+ } else if sys.turbo < 1 {
90+ sclmul = Pow(sclmul, sys.turbo)
91+ }
92+ return MaxF(c.MinScale, MinF(c.ZoomMax, scl*sclmul))
8893 }
8994 return 1
9095 }
@@ -128,7 +133,9 @@ func (c *Camera) action(x, y *float32, leftest, rightest, lowest, highest,
128133 vx += vel
129134 }
130135 }
131- if !sys.debugPaused() {
136+ if sys.debugPaused() {
137+ vx = 0
138+ } else {
132139 vx *= MinF(1, sys.turbo)
133140 }
134141 if vx < 0 {
--- a/src/system.go
+++ b/src/system.go
@@ -1530,10 +1530,7 @@ func (s *System) fight() (reload bool) {
15301530 break
15311531 }
15321532 }
1533- if s.turbo < 1 && !s.debugPaused() {
1534- sclmul = Pow(sclmul, s.turbo)
1535- }
1536- scl = s.cam.ScaleBound(scl * sclmul)
1533+ scl = s.cam.ScaleBound(scl, sclmul)
15371534 tmp := (float32(s.gameWidth) / 2) / scl
15381535 if AbsF((l+r)-(newx-x)*2) >= tmp/2 {
15391536 tmp = MaxF(0, MinF(tmp, MaxF((newx-x)-l, r-(newx-x))))