Converted ShatteredPD to Build from Gradle
Major Changes: - Shattered now builds effortlessly either from gradle CLI or android studio - Much better dependency management through gradle (although it's not really used atm) - Separate PD-classes repo is now SPD-classes module within main repo
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2016 Evan Debenham
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package com.watabou.noosa.tweeners;
|
||||
|
||||
import com.watabou.noosa.Visual;
|
||||
|
||||
public class AlphaTweener extends Tweener {
|
||||
|
||||
public Visual image;
|
||||
|
||||
public float start;
|
||||
public float delta;
|
||||
|
||||
public AlphaTweener( Visual image, float alpha, float time ) {
|
||||
super( image, time );
|
||||
|
||||
this.image = image;
|
||||
start = image.alpha();
|
||||
delta = alpha - start;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateValues( float progress ) {
|
||||
image.alpha( start + delta * progress );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2016 Evan Debenham
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package com.watabou.noosa.tweeners;
|
||||
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.utils.PointF;
|
||||
|
||||
public class CameraScrollTweener extends Tweener {
|
||||
|
||||
public Camera camera;
|
||||
|
||||
public PointF start;
|
||||
public PointF end;
|
||||
|
||||
public CameraScrollTweener( Camera camera, PointF pos, float time ) {
|
||||
super( camera, time );
|
||||
|
||||
this.camera = camera;
|
||||
start = camera.scroll;
|
||||
end = pos;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateValues( float progress ) {
|
||||
camera.scroll = PointF.inter( start, end, progress );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2016 Evan Debenham
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package com.watabou.noosa.tweeners;
|
||||
|
||||
public class Delayer extends Tweener {
|
||||
|
||||
public Delayer() {
|
||||
super( null, 0 );
|
||||
}
|
||||
|
||||
public Delayer( float time ) {
|
||||
super( null, time );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateValues( float progress ) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2016 Evan Debenham
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package com.watabou.noosa.tweeners;
|
||||
|
||||
import com.watabou.noosa.Visual;
|
||||
import com.watabou.utils.PointF;
|
||||
|
||||
public class PosTweener extends Tweener {
|
||||
|
||||
public Visual visual;
|
||||
|
||||
public PointF start;
|
||||
public PointF end;
|
||||
|
||||
public PosTweener( Visual visual, PointF pos, float time ) {
|
||||
super( visual, time );
|
||||
|
||||
this.visual = visual;
|
||||
start = visual.point();
|
||||
end = pos;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateValues( float progress ) {
|
||||
visual.point( PointF.inter( start, end, progress ) );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2016 Evan Debenham
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package com.watabou.noosa.tweeners;
|
||||
|
||||
import com.watabou.noosa.Visual;
|
||||
import com.watabou.utils.PointF;
|
||||
|
||||
public class ScaleTweener extends Tweener {
|
||||
|
||||
public Visual visual;
|
||||
|
||||
public PointF start;
|
||||
public PointF end;
|
||||
|
||||
public ScaleTweener( Visual visual, PointF scale, float time ) {
|
||||
super( visual, time );
|
||||
|
||||
this.visual = visual;
|
||||
start = visual.scale;
|
||||
end = scale;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateValues( float progress ) {
|
||||
visual.scale = PointF.inter( start, end, progress );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2016 Evan Debenham
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package com.watabou.noosa.tweeners;
|
||||
|
||||
import com.watabou.noosa.Game;
|
||||
import com.watabou.noosa.Gizmo;
|
||||
|
||||
abstract public class Tweener extends Gizmo {
|
||||
|
||||
public Gizmo target;
|
||||
|
||||
public float interval;
|
||||
public float elapsed;
|
||||
|
||||
public Listener listener;
|
||||
|
||||
public Tweener( Gizmo target, float interval ) {
|
||||
super();
|
||||
|
||||
this.target = target;
|
||||
this.interval = interval;
|
||||
|
||||
elapsed = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
elapsed += Game.elapsed;
|
||||
if (elapsed >= interval) {
|
||||
updateValues( 1 );
|
||||
onComplete();
|
||||
kill();
|
||||
} else {
|
||||
updateValues( elapsed / interval );
|
||||
}
|
||||
}
|
||||
|
||||
protected void onComplete() {
|
||||
if (listener != null) {
|
||||
listener.onComplete( this );
|
||||
}
|
||||
}
|
||||
|
||||
abstract protected void updateValues( float progress );
|
||||
|
||||
public static interface Listener {
|
||||
void onComplete( Tweener tweener );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user