回答編集履歴

1

boolean使わないといけないので修正

2018/11/22 06:34

投稿

rururu3
rururu3

スコア5545

test CHANGED
@@ -90,7 +90,7 @@
90
90
 
91
91
  float scale = 1.0;
92
92
 
93
- float scaleAdd = 0.01;
93
+ boolean scaleAdd = true;
94
94
 
95
95
  final float MAX_SCALE = 1.5;
96
96
 
@@ -142,11 +142,13 @@
142
142
 
143
143
  // スケール
144
144
 
145
+ float _addScale = this.scaleAdd ? 0.01 : -0.01;
146
+
145
- this.scale = min(max(this.scale + this.scaleAdd, this.MIN_SCALE), this.MAX_SCALE);
147
+ this.scale = min(max(this.scale + _addScale, this.MIN_SCALE), this.MAX_SCALE);
146
148
 
147
149
  if(this.scale >= this.MAX_SCALE || this.scale <= this.MIN_SCALE) {
148
150
 
149
- this.scaleAdd *= -1.0;
151
+ this.scaleAdd = !this.scaleAdd;
150
152
 
151
153
  }
152
154
 
@@ -198,7 +200,7 @@
198
200
 
199
201
  float calcHue(float vx, float vy) {
200
202
 
201
- if(this.scaleAdd > 0.0) {
203
+ if(this.scaleAdd != false) {
202
204
 
203
205
  return (100);
204
206