Revision 4fd9efa1
Added by Leszek Koltunski about 5 years ago
src/main/java/org/distorted/effect/AppearEffectMove.java | ||
---|---|---|
24 | 24 |
import org.distorted.library.type.Dynamic3D; |
25 | 25 |
import org.distorted.library.type.Static3D; |
26 | 26 |
|
27 |
import static org.distorted.magic.RubikRenderer.TEXTURE_SIZE; |
|
28 |
|
|
29 | 27 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
30 | 28 |
|
31 | 29 |
class AppearEffectMove extends AppearEffect |
32 | 30 |
{ |
33 | 31 |
public int createEffects(int duration) |
34 | 32 |
{ |
35 |
mCubeEffectPosition = new int[] {6}; |
|
36 |
mCubeEffects = new Effect[mCubeEffectPosition.length]; |
|
33 |
int w = mScreen.getWidth(); |
|
34 |
int h = mScreen.getHeight(); |
|
35 |
int xmove = w/2 + (w<h?w:h)/2; |
|
36 |
|
|
37 |
mNodeEffectPosition = new int[] {1}; |
|
38 |
mNodeEffects = new Effect[mNodeEffectPosition.length]; |
|
37 | 39 |
|
38 |
Dynamic3D oldCube0 = new Dynamic3D(duration, 0.5f);
|
|
39 |
oldCube0.add(new Static3D(-TEXTURE_SIZE,0,0));
|
|
40 |
oldCube0.add(new Static3D( 0,0,0));
|
|
41 |
mCubeEffects[0] = new MatrixEffectMove(oldCube0);
|
|
40 |
Dynamic3D d0 = new Dynamic3D(duration, 0.5f);
|
|
41 |
d0.add(new Static3D(-xmove,0,0));
|
|
42 |
d0.add(new Static3D( 0,0,0));
|
|
43 |
mNodeEffects[0] = new MatrixEffectMove(d0);
|
|
42 | 44 |
|
43 | 45 |
return 1; |
44 | 46 |
} |
Also available in: Unified diff
Add support for separate Cube and Node effects.