Added:
trunk/content_package/run.humanoid.animation
Modified:
trunk/content_package/jump.humanoid.animation
trunk/content_package/stand.humanoid.animation
trunk/src/android/com/abb/Avatar.java
trunk/src/android/com/abb/GameState.java
Log:
Updated animations. Added run animation. Fixed weapon drawing bug in
GameState.java.
Modified: trunk/content_package/jump.humanoid.animation
==============================================================================
--- trunk/content_package/jump.humanoid.animation (original)
+++ trunk/content_package/jump.humanoid.animation Sat Dec 20 09:05:12 2008
@@ -1,19 +1,19 @@
root 0.0 0
-root 0.75 360
+root 1.0 360
-thigh_r 0.0 -35
-thigh_l 0.0 35
+thigh_r 0.0 -45
+thigh_l 0.0 -45
leg_r 0.0 50
-leg_l 0.0 -50
+leg_l 0.0 50
-torso 0.0 110
+torso 0.0 -110
-shoulder_r 0.0 95
-shoulder_l 0.0 125
+shoulder_r 0.0 -110
+shoulder_l 0.0 -110
-arm_r 0.0 -140
+arm_r 0.0 140
arm_l 0.0 140
-farm_r 0.0 90
+farm_r 0.0 -90
farm_l 0.0 -90
Added: trunk/content_package/run.humanoid.animation
==============================================================================
--- (empty file)
+++ trunk/content_package/run.humanoid.animation Sat Dec 20 09:05:12 2008
@@ -0,0 +1,39 @@
+root 0.0 0
+
+thigh_r 0.0 -60
+thigh_r 1.0 50
+thigh_r 2.0 -60
+
+thigh_l 0.0 50
+thigh_l 1.0 -60
+thigh_l 2.0 50
+
+leg_r 0.0 20
+leg_r 1.0 40
+leg_r 2.0 20
+
+leg_l 0.0 40
+leg_l 1.0 20
+leg_l 2.0 40
+
+torso 0.0 179
+torso 1.0 181
+torso 2.0 179
+
+shoulder_r 0.0 160
+shoulder_r 1.0 170
+shoulder_r 2.0 160
+
+shoulder_l 0.0 190
+shoulder_l 1.0 200
+shoulder_l 2.0 190
+
+arm_r 0.0 -110
+arm_l 0.0 140
+
+farm_r 0.0 -110
+farm_l 0.0 -80
+
+head 0.0 0
+head 1.0 20
+head 2.0 0
Modified: trunk/content_package/stand.humanoid.animation
==============================================================================
--- trunk/content_package/stand.humanoid.animation (original)
+++ trunk/content_package/stand.humanoid.animation Sat Dec 20 09:05:12 2008
@@ -3,8 +3,8 @@
thigh_r 0.0 -40
thigh_l 0.0 40
-leg_r 0.0 20
-leg_l 0.0 -20
+leg_r 0.0 10
+leg_l 0.0 -10
torso 0.0 179
torso 1.0 181
@@ -18,8 +18,8 @@
shoulder_l 1.0 195
shoulder_l 2.0 200
-arm_r 0.0 -140
+arm_r 0.0 -110
arm_l 0.0 140
-farm_r 0.0 130
-farm_l 0.0 -130
+farm_r 0.0 -110
+farm_l 0.0 -80
Modified: trunk/src/android/com/abb/Avatar.java
==============================================================================
--- trunk/src/android/com/abb/Avatar.java (original)
+++ trunk/src/android/com/abb/Avatar.java Sat Dec 20 09:05:12 2008
@@ -54,30 +54,19 @@
sprite_flipped_horizontal = facing_left_;
}
- if (has_ground_contact)
-
loadAnimationFromUri(Uri.parse("content:///stand.humanoid.animation"));
- else
-
loadAnimationFromUri(Uri.parse("content:///jump.humanoid.animation"));
- stepAnimation(time_step);
-
- /*
- int sprite_index = 0;
if (has_ground_contact) {
if (Math.abs(dx) > kAnimationStopThreshold) {
- animation_phase_ += kGroundAnimationSpeed * Math.abs(dx);
- while (animation_phase_ > 1.0f)
- animation_phase_ -= 1.0f;
- sprite_index = 1 + (int)(3 * animation_phase_);
+
loadAnimationFromUri(Uri.parse("content:///run.humanoid.animation"));
+ stepAnimation(kGroundAnimationSpeed * Math.abs(dx));
+ } else {
+
loadAnimationFromUri(Uri.parse("content:///stand.humanoid.animation"));
+ stepAnimation(time_step);
}
- } else { // In the air
- animation_phase_ += kAirAnimationSpeed * time_step;
- while (animation_phase_ > 1.0f)
- animation_phase_ -= 1.0f;
- sprite_index = 5 + (int)(4 * animation_phase_);
+ } else {
+
loadAnimationFromUri(Uri.parse("content:///jump.humanoid.animation"));
+ stepAnimation(time_step);
}
- setSprite(sprite_index, facing_left_);
- */
mWeapon.setSprite(facing_left_);
// Update the shooting mechanism. The choices for shot direction are
@@ -151,7 +140,6 @@
public Weapon mWeapon = new Weapon(game_state_);
private static final float kAirAcceleration = 40.0f;
- private static final float kAirAnimationSpeed = 3.0f;
private static final float kAnimationStopThreshold = 40.0f;
private static final float kDrawingScale = 0.4f;
private static final float kGravity = 200.0f;
Modified: trunk/src/android/com/abb/GameState.java
==============================================================================
--- trunk/src/android/com/abb/GameState.java (original)
+++ trunk/src/android/com/abb/GameState.java Sat Dec 20 09:05:12 2008
@@ -179,10 +179,12 @@
((Entity)it.next()).draw(graphics, view_x_, view_y_, zoom_);
// Draw the avatar and weapon.
- if (avatar.alive)
+ if (avatar.alive) {
avatar.draw(graphics, view_x_, view_y_, zoom_);
- avatar.mWeapon.setImage(graphics);
- avatar.mWeapon.draw(graphics, view_x_, view_y_, zoom_);
+ avatar.mWeapon.setImage(graphics);
+ avatar.mWeapon.draw(graphics, view_x_, view_y_, zoom_);
+ }
+
// Draw the projectiles.
for (Iterator it = projectiles.iterator(); it.hasNext();)
((Entity)it.next()).draw(graphics, view_x_, view_y_, zoom_);