[alienbloodbath commit] r82 - Controls completely revamped. Improved graphics performance. Added background drawings.

2 views
Skip to first unread message

codesite...@google.com

unread,
Apr 25, 2009, 11:52:07 PM4/25/09
to alien-blood-b...@googlegroups.com
Author: matt.burkhart
Date: Sat Apr 25 20:30:29 2009
New Revision: 82

Added:
trunk/icon/
trunk/icon/ak49.png (contents, props changed)
trunk/icon/icon.svg (contents, props changed)
- copied, changed from r81, /trunk/icon.svg
trunk/icon/splat.png (contents, props changed)
Removed:
trunk/icon.svg
Modified:
trunk/content_package/misc.png
trunk/res/drawable/icon.png
trunk/src/android/com/abb/Avatar.java
trunk/src/android/com/abb/Entity.java
trunk/src/android/com/abb/GameState.java
trunk/src/android/com/abb/GameView.java
trunk/src/android/com/abb/Graphics.java
trunk/src/android/com/abb/Map.java
trunk/src/android/com/abb/Weapon.java

Log:
Controls completely revamped. Improved graphics performance. Added
background drawings.

Modified: trunk/content_package/misc.png
==============================================================================
Binary files. No diff available.

Added: trunk/icon/ak49.png
==============================================================================
Binary file. No diff available.

Copied: trunk/icon/icon.svg (from r81, /trunk/icon.svg)
==============================================================================
--- /trunk/icon.svg (original)
+++ trunk/icon/icon.svg Sat Apr 25 20:30:29 2009
@@ -17,8 +17,8 @@
sodipodi:docname="icon.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
inkscape:export-filename="/home/burkhart/Desktop/icon.png"
- inkscape:export-xdpi="96.529999"
- inkscape:export-ydpi="96.529999"
+ inkscape:export-xdpi="95.910004"
+ inkscape:export-ydpi="95.910004"
version="1.0">
<sodipodi:namedview
id="base"
@@ -30,274 +30,316 @@
objecttolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
- inkscape:zoom="4.5443396"
- inkscape:cx="18.637266"
- inkscape:cy="5.3161026"
+ inkscape:zoom="7.110381"
+ inkscape:cx="29.879173"
+ inkscape:cy="33.44026"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
- inkscape:window-width="999"
- inkscape:window-height="987"
- inkscape:window-x="37"
- inkscape:window-y="133" />
+ inkscape:window-width="1077"
+ inkscape:window-height="990"
+ inkscape:window-x="332"
+ inkscape:window-y="20" />
<defs
id="defs4">
<linearGradient
id="linearGradient5259">
<stop
- style="stop-color:#ffffff;stop-opacity:1;"
+ id="stop5261"
offset="0"
- id="stop5261" />
+ style="stop-color:#ffffff;stop-opacity:1;" />
<stop
- style="stop-color:#ffffff;stop-opacity:0.27808675;"
+ id="stop5263"
offset="1"
- id="stop5263" />
+ style="stop-color:#ffffff;stop-opacity:0.27808675;" />
</linearGradient>
<linearGradient
id="linearGradient5221">
<stop
- id="stop5223"
+ style="stop-color:#ffffff;stop-opacity:0.99110121;"
offset="0"
- style="stop-color:#ffffff;stop-opacity:0.99110121;" />
+ id="stop5223" />
<stop
- id="stop5225"
+ style="stop-color:#fffeff;stop-opacity:0.23470522;"
offset="1"
- style="stop-color:#fffeff;stop-opacity:0.23470522;" />
+ id="stop5225" />
</linearGradient>
<linearGradient
id="linearGradient5031">
<stop
- style="stop-color:#c8c8c8;stop-opacity:1;"
+ id="stop5033"
offset="0"
- id="stop5033" />
+ style="stop-color:#c8c8c8;stop-opacity:1;" />
<stop
- style="stop-color:#a9aaaa;stop-opacity:0.22135706;"
+ id="stop5035"
offset="1"
- id="stop5035" />
+ style="stop-color:#a9aaaa;stop-opacity:0.22135706;" />
</linearGradient>
<linearGradient
id="linearGradient5025">
<stop
- style="stop-color:#c8c8c8;stop-opacity:1;"
+ id="stop5027"
offset="0"
- id="stop5027" />
+ style="stop-color:#c8c8c8;stop-opacity:1;" />
<stop
- style="stop-color:#000000;stop-opacity:1"
+ id="stop5029"
offset="1"
- id="stop5029" />
+ style="stop-color:#000000;stop-opacity:1" />
</linearGradient>
<linearGradient
- id="linearGradient3484"
- inkscape:collect="always">
+ inkscape:collect="always"
+ id="linearGradient3484">
<stop
- id="stop3486"
+ style="stop-color:#800000;stop-opacity:1;"
offset="0"
- style="stop-color:#800000;stop-opacity:1;" />
+ id="stop3486" />
<stop
- id="stop3488"
+ style="stop-color:#800000;stop-opacity:0;"
offset="1"
- style="stop-color:#800000;stop-opacity:0;" />
+ id="stop3488" />
</linearGradient>
<linearGradient
id="linearGradient3306">
<stop
- id="stop3308"
+ style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
- style="stop-color:#ffffff;stop-opacity:1;" />
+ id="stop3308" />
<stop
- id="stop3310"
+ style="stop-color:#ffffff;stop-opacity:0;"
offset="1"
- style="stop-color:#ffffff;stop-opacity:0;" />
+ id="stop3310" />
</linearGradient>
<linearGradient
id="linearGradient3293">
<stop
- id="stop3295"
+ style="stop-color:#c8c8c8;stop-opacity:1;"
offset="0"
- style="stop-color:#c8c8c8;stop-opacity:1;" />
+ id="stop3295" />
<stop
- id="stop3297"
+ style="stop-color:#000000;stop-opacity:1"
offset="1"
- style="stop-color:#000000;stop-opacity:1" />
+ id="stop3297" />
</linearGradient>
<linearGradient
id="linearGradient3283">
<stop
- id="stop3285"
+ style="stop-color:#000000;stop-opacity:1;"
offset="0"
- style="stop-color:#000000;stop-opacity:1;" />
+ id="stop3285" />
<stop
- id="stop3287"
+ style="stop-color:#000000;stop-opacity:1;"
offset="1"
- style="stop-color:#000000;stop-opacity:1;" />
+ id="stop3287" />
</linearGradient>
<inkscape:perspective
- id="perspective10"
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective10" />
+ <inkscape:perspective
+ id="perspective3473"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 526.18109 : 1"
sodipodi:type="inkscape:persp3d" />
+ <filter
+ inkscape:collect="always"
+ id="filter3644"
+ x="-0.18763675"
+ width="1.3752735"
+ y="-0.20056684"
+ height="1.4011337">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="4.8888169"
+ id="feGaussianBlur3646" />
+ </filter>
+ <inkscape:perspective
+ id="perspective2606"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <linearGradient
+ y2="362.52921"
+ x2="268.32932"
+ y1="410.41904"
+ x1="306.34872"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient4069"
+ xlink:href="#linearGradient3484"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="351.57248"
+ x2="269.42603"
+ y1="296.73862"
+ x1="269.42603"
+
gradientTransform="matrix(0.6449885,0.1252405,9.0503352e-2,0.6033556,59.67261,113.67871)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient4073"
+ xlink:href="#linearGradient3306"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="389.62317"
+ x2="253.70647"
+ y1="358.6004"
+ x1="253.70647"
+
gradientTransform="matrix(0.6449885,0.1252405,9.0503352e-2,0.6033556,59.67261,113.67871)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient4077"
+ xlink:href="#linearGradient3293"
+ inkscape:collect="always" />
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1,0,0,0.9810449,-1.7604318,9.4579355)"
+ r="27.687138"
+ fy="348.04514"
+ fx="260.88733"
+ cy="348.04514"
+ cx="260.88733"
+ id="radialGradient4854"
+ xlink:href="#linearGradient5025"
+ inkscape:collect="always" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
- id="perspective3473" />
- <filter
- height="1.4011337"
- y="-0.20056684"
- width="1.3752735"
- x="-0.18763675"
- id="filter3644"
- inkscape:collect="always">
- <feGaussianBlur
- id="feGaussianBlur3646"
- stdDeviation="4.8888169"
- inkscape:collect="always" />
- </filter>
+ id="perspective4900" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
- id="perspective2606" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3484"
- id="linearGradient4069"
+ id="perspective4950" />
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective5000" />
+ <radialGradient
+ r="27.687138"
+ fy="348.04514"
+ fx="260.88733"
+ cy="348.04514"
+ cx="260.88733"
+ gradientTransform="matrix(1,0,0,0.9810449,0.3833718,7.817361)"
gradientUnits="userSpaceOnUse"
- x1="306.34872"
- y1="410.41904"
- x2="268.32932"
- y2="362.52921" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3306"
- id="linearGradient4073"
+ id="radialGradient5021"
+ xlink:href="#linearGradient5031"
+ inkscape:collect="always" />
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1,0,0,0.8704694,0,3.1067105)"
+ r="26.296875"
+ fy="23.984375"
+ fx="31.796875"
+ cy="23.984375"
+ cx="31.796875"
+ id="radialGradient5219"
+ xlink:href="#linearGradient5221"
+ inkscape:collect="always" />
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1,0,0,0.9810449,-0.6601619,6.6199915)"
+ r="27.687138"
+ fy="349.24576"
+ fx="261.93088"
+ cy="349.24576"
+ cx="261.93088"
+ id="radialGradient5257"
+ xlink:href="#linearGradient5259"
+ inkscape:collect="always" />
+ <radialGradient
+ r="27.687138"
+ fy="348.04514"
+ fx="260.88733"
+ cy="348.04514"
+ cx="260.88733"
+ gradientTransform="matrix(1,0,0,0.9810449,-1.7604318,9.6779895)"
gradientUnits="userSpaceOnUse"
+ id="radialGradient5265"
+ xlink:href="#linearGradient5025"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="389.62317"
+ x2="253.70647"
+ y1="358.6004"
+ x1="253.70647"

gradientTransform="matrix(0.6449885,0.1252405,9.0503352e-2,0.6033556,59.67261,113.67871)"
- x1="269.42603"
- y1="296.73862"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient5267"
+ xlink:href="#linearGradient3293"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="351.57248"
x2="269.42603"
- y2="351.57248" />
+ y1="296.73862"
+ x1="269.42603"
+
gradientTransform="matrix(0.6449885,0.1252405,9.0503352e-2,0.6033556,59.67261,113.67871)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient5269"
+ xlink:href="#linearGradient3306"
+ inkscape:collect="always" />
<linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3293"
- id="linearGradient4077"
+ y2="362.52921"
+ x2="268.32932"
+ y1="410.41904"
+ x1="306.34872"
gradientUnits="userSpaceOnUse"
-
gradientTransform="matrix(0.6449885,0.1252405,9.0503352e-2,0.6033556,59.67261,113.67871)"
- x1="253.70647"
- y1="358.6004"
- x2="253.70647"
- y2="389.62317" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient5025"
- id="radialGradient4854"
- cx="260.88733"
- cy="348.04514"
- fx="260.88733"
- fy="348.04514"
- r="27.687138"
- gradientTransform="matrix(1,0,0,0.9810449,-1.7604318,9.4579355)"
- gradientUnits="userSpaceOnUse" />
+ id="linearGradient5271"
+ xlink:href="#linearGradient3484"
+ inkscape:collect="always" />
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective2493" />
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective2543" />
<inkscape:perspective
- id="perspective4900"
+ id="perspective2843"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 526.18109 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
- id="perspective4950"
+ id="perspective2893"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 526.18109 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
- id="perspective5000"
+ id="perspective2512"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective2562"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 526.18109 : 1"
sodipodi:type="inkscape:persp3d" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient5031"
- id="radialGradient5021"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1,0,0,0.9810449,0.3833718,7.817361)"
- cx="260.88733"
- cy="348.04514"
- fx="260.88733"
- fy="348.04514"
- r="27.687138" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient5221"
- id="radialGradient5219"
- cx="31.796875"
- cy="23.984375"
- fx="31.796875"
- fy="23.984375"
- r="26.296875"
- gradientTransform="matrix(1,0,0,0.8704694,0,3.1067105)"
- gradientUnits="userSpaceOnUse" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient5259"
- id="radialGradient5257"
- cx="261.93088"
- cy="349.24576"
- fx="261.93088"
- fy="349.24576"
- r="27.687138"
- gradientTransform="matrix(1,0,0,0.9810449,-0.6601619,6.6199915)"
- gradientUnits="userSpaceOnUse" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient5025"
- id="radialGradient5265"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1,0,0,0.9810449,-1.7604318,9.6779895)"
- cx="260.88733"
- cy="348.04514"
- fx="260.88733"
- fy="348.04514"
- r="27.687138" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3293"
- id="linearGradient5267"
- gradientUnits="userSpaceOnUse"
-
gradientTransform="matrix(0.6449885,0.1252405,9.0503352e-2,0.6033556,59.67261,113.67871)"
- x1="253.70647"
- y1="358.6004"
- x2="253.70647"
- y2="389.62317" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3306"
- id="linearGradient5269"
- gradientUnits="userSpaceOnUse"
-
gradientTransform="matrix(0.6449885,0.1252405,9.0503352e-2,0.6033556,59.67261,113.67871)"
- x1="269.42603"
- y1="296.73862"
- x2="269.42603"
- y2="351.57248" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3484"
- id="linearGradient5271"
- gradientUnits="userSpaceOnUse"
- x1="306.34872"
- y1="410.41904"
- x2="268.32932"
- y2="362.52921" />
</defs>
<metadata
id="metadata7">
@@ -311,51 +353,54 @@
</rdf:RDF>
</metadata>
<g
- transform="translate(-228.90326,-322.08343)"
- id="layer1"
+ inkscape:label="Layer 1"
inkscape:groupmode="layer"
- inkscape:label="Layer 1">
+ id="layer1"
+ transform="translate(-228.90326,-322.08343)">
<path
-
style="fill:url(#radialGradient5257);fill-opacity:1;stroke-width:1.60000002;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4"
+ id="path5243"
d="M 239.51625,322.21513 L 275.97796,329.29508 C
279.78987,330.03525 283.3161,333.68073 283.88431,337.46879 L
288.88021,370.77478 C 289.44842,374.56284 286.83707,377.01655
283.02516,376.27638 L 246.56345,369.19643 C 242.75154,368.45626
239.2253,364.81078 238.6571,361.02272 L 233.6612,327.71673 C
233.09299,323.92867 235.70434,321.47496 239.51625,322.21513 z"
- id="path5243" />
+
style="fill:url(#radialGradient5257);fill-opacity:1;stroke-width:1.60000002;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4"
/>
<path
-
style="fill:#c8c8c8;fill-opacity:1;stroke-width:1.60000002;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4"
+ id="rect3281"
d="M 234.83594,325.79089 L 271.29765,332.87084 C
275.10956,333.61101 278.63579,337.25649 279.204,341.04455 L
284.1999,374.35054 C 284.76811,378.1386 282.15676,380.59231
278.34485,379.85214 L 241.88314,372.77219 C 238.07123,372.03202
234.54499,368.38654 233.97679,364.59848 L 228.98089,331.29249 C
228.41268,327.50443 231.02403,325.05072 234.83594,325.79089 z"
- id="rect3281" />
+
style="fill:#c8c8c8;fill-opacity:1;stroke-width:1.60000002;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4"
/>
<path
-
style="fill:url(#radialGradient5265);fill-opacity:1;stroke-width:1.60000002;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4"
+ id="path4080"
d="M 237.37245,324.09527 L 273.83416,331.17522 C
277.64607,331.91539 281.1723,335.56087 281.74051,339.34893 L
286.73641,372.65492 C 287.30462,376.44298 284.69327,378.89669
280.88136,378.15652 L 244.41965,371.07657 C 240.60774,370.3364
237.0815,366.69092 236.5133,362.90286 L 231.5174,329.59687 C
230.94919,325.80881 233.56054,323.3551 237.37245,324.09527 z"
- id="path4080" />
+
style="fill:url(#radialGradient5265);fill-opacity:1;stroke-width:1.60000002;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4"
/>
<path
-
style="fill:url(#linearGradient5267);fill-opacity:1;stroke-width:1.60000002;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4"
+ id="rect3291"
d="M 234.83594,325.79089 L 271.29765,332.87084 C
275.10956,333.61101 278.63579,337.25649 279.204,341.04455 L
284.1999,374.35054 C 284.76811,378.1386 282.15676,380.59231
278.34485,379.85214 L 241.88314,372.77219 C 238.07123,372.03202
234.54499,368.38654 233.97679,364.59848 L 228.98089,331.29249 C
228.41268,327.50443 231.02403,325.05072 234.83594,325.79089 z"
- id="rect3291" />
+
style="fill:url(#linearGradient5267);fill-opacity:1;stroke-width:1.60000002;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4"
/>
<path
- id="rect3301"
+
style="fill:url(#linearGradient5269);fill-opacity:1;stroke-width:1.60000002;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
d="M 234.85578,326.9991 C 230.47874,326.39099 229.26044,330.77877
230.72634,334.56296 C 230.88391,337.15673 231.11723,339.84714
234.25021,341.61759 C 248.69047,352.60104 267.6289,356.17967
279.31383,350.07492 C 277.86681,345.41875 279.77452,339.67009
274.53738,335.58293 C 269.91397,332.55697 264.84434,333.38478
260.0853,331.86142 C 251.6785,330.25496 243.24927,328.54142
234.85578,326.9991 z"
-
style="fill:url(#linearGradient5269);fill-opacity:1;stroke-width:1.60000002;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
/>
- <image
- xlink:href="content_package/The_Second_Wave/hopper.png"
-
sodipodi:absref="/home/burkhart/programming/alienbloodbath/content_package/The_Second_Wave/hopper.png"
- width="42.481647"
- height="39.447327"
- id="image3475"
- x="191.30907"
- y="304.26538"
- transform="matrix(0.981665,0.1906146,0.1483405,0.9889363,0,0)" />
+ id="rect3301" />
<path
- id="rect3479"
- d="M 278.375,323.40625 C 253.65507,323.40625 233.59375,345.01926
233.59375,371.65625 C 233.59375,375.1754 233.96016,378.60057
234.625,381.90625 L 284.78125,381.90625 C 291.05957,381.90625
296.125,376.84083 296.125,370.5625 L 296.125,327.375 C 290.68296,324.83923
284.67799,323.40625 278.375,323.40625 z"
+
transform="matrix(0.6449885,0.1252405,9.0503352e-2,0.6033556,57.611229,111.06633)"

style="fill:url(#linearGradient5271);fill-opacity:1;stroke-width:1.60000002;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;filter:url(#filter3644)"
-
transform="matrix(0.6449885,0.1252405,9.0503352e-2,0.6033556,57.611229,111.06633)"
/>
+ d="M 278.375,323.40625 C 253.65507,323.40625 233.59375,345.01926
233.59375,371.65625 C 233.59375,375.1754 233.96016,378.60057
234.625,381.90625 L 284.78125,381.90625 C 291.05957,381.90625
296.125,376.84083 296.125,370.5625 L 296.125,327.375 C 290.68296,324.83923
284.67799,323.40625 278.375,323.40625 z"
+ id="rect3479" />
+ <image
+ y="277.4151"
+ x="257.63046"
+ id="image2895"
+ height="15.49692"
+ width="47.025471"
+ sodipodi:absref="/home/burkhart/Desktop/ak49.png"
+ xlink:href="ak49.png"
+ transform="matrix(0.9708586,0.2396531,-6.1094352e-2,0.998132,0,0)"
+ inkscape:export-xdpi="209.02"
+ inkscape:export-ydpi="209.02" />
<image
- y="354.60986"
- x="254.63361"
- id="image5002"
- height="23.73266"
- width="30.023247"
- sodipodi:absref="/home/burkhart/Desktop/blood_splatter.png"
- xlink:href="/home/burkhart/Desktop/blood_splatter.png" />
+ y="318.6478"
+ x="184.67566"
+ id="image2564"
+ height="17.367208"
+ width="51.348728"
+ sodipodi:absref="/home/burkhart/Desktop/splat.png"
+ xlink:href="splat.png"
+ transform="matrix(0.9773765,0.2115068,0.1618296,0.9868187,0,0)" />
</g>
</svg>

Added: trunk/icon/splat.png
==============================================================================
Binary file. No diff available.

Modified: trunk/res/drawable/icon.png
==============================================================================
Binary files. No diff available.

Modified: trunk/src/android/com/abb/Avatar.java
==============================================================================
--- trunk/src/android/com/abb/Avatar.java (original)
+++ trunk/src/android/com/abb/Avatar.java Sat Apr 25 20:30:29 2009
@@ -34,18 +34,24 @@
return;
}

+ // General motion updates.
ddy = kGravity;
super.step(time_step);
+ dx = Math.min(Math.max(dx, -kMaxHorizontalVelocity),
kMaxHorizontalVelocity);
+ dy = Math.min(Math.max(dy, -kMaxVerticalVelocity),
kMaxVerticalVelocity);
+ if (dy > 0.0f) {
+ mJumping = false;
+ }

// Update the horizontal acceleration according to the current
controls and
// the contact with the ground.
- if (ddx > 0 && has_ground_contact) {
+ if (ddx > 0.0f && has_ground_contact) {
ddx = +kGroundAcceleration;
- } else if (ddx > 0 && !has_ground_contact) {
+ } else if (ddx > 0.0f && !has_ground_contact) {
ddx = +kAirAcceleration;
- } else if (ddx < 0 && has_ground_contact) {
+ } else if (ddx < 0.0f && has_ground_contact) {
ddx = -kGroundAcceleration;
- } else if (ddx < 0 && !has_ground_contact) {
+ } else if (ddx < 0.0f && !has_ground_contact) {
ddx = -kAirAcceleration;
}

@@ -62,9 +68,9 @@
}

// Update the avatar animation.
- if (dx < 0) {
+ if (dx < 0.0f) {
sprite_flipped_horizontal = true;
- } else if (dx > 0) {
+ } else if (dx > 0.0f) {
sprite_flipped_horizontal = false;
}
if (has_ground_contact) {
@@ -124,22 +130,22 @@

// Draw the avatar life and ammo meters.
float meter_width = mCanvasWidth - 45;
- mRect.set(0, 0, 28, 13);
- mRectF.set(0, 0, 28, 13);
+ mRect.set(0, 0, 31, 17);
+ mRectF.set(0, 0, 31, 17);
graphics.drawImage(mGameState.misc_sprites, mRect, mRectF, false,
false);
if (life > 0.0f) {
- float life_meter_width =
- meter_width * life;
- mRect.set(0, 16, 64, 20);
- mRectF.set(30, 1, 30 + life_meter_width, 6);
+ float life_meter_width = meter_width * life;
+ mRect.set(0, 22, 64, 26);
+ mRectF.set(32, 2, 32 + life_meter_width, 6);
graphics.drawImage(mGameState.misc_sprites, mRect, mRectF, false,
false);
}
if (mWeapon != null) {
float ammo_meter_width =
- meter_width * mWeapon.getAmmo() / mWeapon.getMaxAmmo();
+ Math.min(meter_width,
+ meter_width * mWeapon.getAmmo() / mWeapon.getMaxAmmo());
ammo_meter_width = Math.max(ammo_meter_width, 0.0f);
- mRect.set(0, 23, 64, 27);
- mRectF.set(30, 8, 30 + ammo_meter_width, 12);
+ mRect.set(0, 29, 64, 33);
+ mRectF.set(32, 8, 32 + ammo_meter_width, 12);
graphics.drawImage(mGameState.misc_sprites, mRect, mRectF, false,
false);
}
}
@@ -149,16 +155,29 @@
return;
}

+ // Horizontal movement.
if (key_code == kKeyLeft) {
- dx -= kVelocityBoost;
ddx = -kGroundAcceleration * state;
- } else if (key_code == kKeyRight) {
- dx += kVelocityBoost;
+ }
+ if (key_code == kKeyRight) {
ddx = +kGroundAcceleration * state;
- } else if (key_code == kKeyJump && state == 1 && has_ground_contact) {
+ }
+
+ // Vertical movement. The following is tricky since plausible physics
+ // simulations are not preferred by users, yet we still want to let
users
+ // interact with physical objects in the game.
+ if (key_code == kKeyJump && state == 1 && has_ground_contact) {
dy -= kJumpVelocity;
has_ground_contact = false;
- } else if (key_code == kKeyShoot) {
+ mJumping = true;
+ }
+ if (key_code == kKeyJump && state == 0 && mJumping && dy < 0.0f) {
+ dy = Math.min(0.0f, dy + kJumpVelocity);
+ mJumping = false;
+ }
+
+ // Shooting.
+ if (key_code == kKeyShoot) {
if (mWeapon != null) {
mWeapon.enableShooting(state == 1);
}
@@ -225,6 +244,7 @@
private int mCanvasWidth;
private int mCanvasHeight;
private GameState mGameState;
+ private boolean mJumping;
public Weapon mWeapon;

// To avoid allocations...
@@ -232,14 +252,16 @@
private Rect mRect = new Rect();
private RectF mRectF = new RectF();

- private static final float kAirAcceleration = 40.0f;
+ private static final float kAirAcceleration = 2000.0f;
private static final float kAnimationStopThreshold = 40.0f;
private static final float kDrawingScale = 0.4f;
private static final float kGravity = 300.0f;
- private static final float kGroundAcceleration = 700.0f;
+ private static final float kGroundAcceleration = 2000.0f;
private static final float kGroundAnimationSpeed = 1.0f / 1500.0f;
private static final float kGroundKineticFriction = 0.3f;
private static final float kMaxGroundVelocity = 200.0f;
+ private static final float kMaxHorizontalVelocity = 300.0f;
+ private static final float kMaxVerticalVelocity = 300.0f;
private static final float kJumpVelocity = 295.0f;
private static final int kKeyLeft = KeyEvent.KEYCODE_A;
private static final int kKeyRight = KeyEvent.KEYCODE_S;

Modified: trunk/src/android/com/abb/Entity.java
==============================================================================
--- trunk/src/android/com/abb/Entity.java (original)
+++ trunk/src/android/com/abb/Entity.java Sat Apr 25 20:30:29 2009
@@ -138,6 +138,6 @@
private static final int kFlameSpriteBase = 521;
private static final int kFlameSpriteWidth = 64;
private static final int kFlameSpriteHeight = 36;
- private static final float kMaxHorizontalVelocity = 300.0f;
- private static final float kMaxVerticalVelocity = 400.0f;
+ private static final float kMaxHorizontalVelocity = 500.0f;
+ private static final float kMaxVerticalVelocity = 500.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 Apr 25 20:30:29 2009
@@ -389,7 +389,7 @@
private static final long kEnemyAttackVibrateLength = 50; //
Milliseconds.
private static final long kEnemyDeathVibrateLength = 30; //
Milliseconds.
private static final float kGravity = 200.0f;
- private static final float kGroundZoom = 0.8f;
+ private static final float kGroundZoom = 0.85f;
private static final float kViewLead = 1.0f;
private static final float kViewSpeed = 2.0f;
private static final float kZoomSpeed = 1.0f;

Modified: trunk/src/android/com/abb/GameView.java
==============================================================================
--- trunk/src/android/com/abb/GameView.java (original)
+++ trunk/src/android/com/abb/GameView.java Sat Apr 25 20:30:29 2009
@@ -191,7 +191,7 @@
@Override
public void handleMessage(Message msg) {
Log.d("GameView::Handler::handleMessage",
- "Recived message: " + msg.what);
+ "Received message: " + msg.what);
if (msg.what == kNotificationMessage) {
Builder dialog = new AlertDialog.Builder(mContext);
dialog.setMessage(((String)msg.obj) + " (Press back to
continue.)");

Modified: trunk/src/android/com/abb/Graphics.java
==============================================================================
--- trunk/src/android/com/abb/Graphics.java (original)
+++ trunk/src/android/com/abb/Graphics.java Sat Apr 25 20:30:29 2009
@@ -157,13 +157,14 @@

public void drawImage(int image_handle, Rect source_rect, RectF
dest_rect,
boolean flipped_horizontal, boolean
flipped_vertical) {
+ /* DEBUGGING ONLY
Assert.assertTrue("Invalid image handle in drawImage", image_handle >=
0);
-
// The drawImageOpenGL implementation has been inlined here for
performance
// reasons. TODO: Inline the 2D API implementation here.
Assert.assertEquals(mBackendType, BackendType.OPENGL);
+ */

- if (image_handle >= mTextureWidths.size()) {
+ if (image_handle >= mTextureData.size()) {
Log.d("Graphics::drawImage", "Unknown image handle encountered. " +
"Assuming OpenGL context has been lost. Exiting.");
mContextLost = true;
@@ -179,8 +180,9 @@
// All that is left is to set up the texture and model view
transformation
// matrices and render. Note that the OpenGL API expects matrices with
a
// column-major layout.
- float texture_width = mTextureWidths.get(image_handle);
- float texture_height = mTextureHeights.get(image_handle);
+ TextureData texture_data = mTextureData.get(image_handle);
+ float texture_width = texture_data.width;
+ float texture_height = texture_data.height;

mMatrix4x4[1] = mMatrix4x4[2] = mMatrix4x4[4] =
mMatrix4x4[6] = mMatrix4x4[8] = mMatrix4x4[9] = 0.0f;
@@ -214,19 +216,20 @@

public void drawImage(int image_handle, Rect source_rect, Matrix
dest_matrix,
boolean flipped_horizontal, boolean
flipped_vertical) {
+ /* DEBUGGING ONLY
Assert.assertTrue("Invalid image handle in drawImage", image_handle >=
0);
+ // The drawImageOpenGL implementation has been inlined here for
performance
+ // reasons. TODO: Inline the 2D API implementation here.
+ Assert.assertEquals(mBackendType, BackendType.OPENGL);
+ */

- if (image_handle >= mTextureWidths.size()) {
+ if (image_handle >= mTextureData.size()) {
Log.d("Graphics::drawImage", "Unknown image handle encountered. " +
"Assuming OpenGL context has been lost. Exiting.");
mContextLost = true;
return;
}

- // The drawImageOpenGL implementation has been inlined here for
performance
- // reasons. TODO: Inline the 2D API implementation here.
- Assert.assertEquals(mBackendType, BackendType.OPENGL);
-
if (image_handle != mCurrentTexture) {
mCurrentTexture = image_handle;
mGl.glBindTexture(GL10.GL_TEXTURE_2D, image_handle);
@@ -236,8 +239,9 @@
// All that is left is to set up the texture and model view
transformation
// matrices and render. Note that the OpenGL API expects matrices with
a
// column-major layout.
- float texture_width = mTextureWidths.get(image_handle);
- float texture_height = mTextureHeights.get(image_handle);
+ TextureData texture_data = mTextureData.get(image_handle);
+ float texture_width = texture_data.width;
+ float texture_height = texture_data.height;

mMatrix4x4[1] = mMatrix4x4[2] = mMatrix4x4[4] =
mMatrix4x4[6] = mMatrix4x4[8] = mMatrix4x4[9] = 0.0f;
@@ -502,7 +506,7 @@

// Default settings for unknown hardware considerations. We choose to
be on
// the save side with respect to performance considerations.
- mHasHardwareAcceleration = false;
+ mHasHardwareAcceleration = true;

// Dream / G1.
if (gl_renderer.indexOf("Q3Dimension") != -1) {
@@ -610,14 +614,13 @@
// The size must be manually stored for retrieval during the rendering
// process since the texture coordinate scheme under OpenGL is
normalized
// where as under the Android2D back end, texture coordinates are
absolute.
- if (mTextureWidths.size() <= texture_name) {
- mTextureWidths.setSize(texture_name + 1);
- }
- if (mTextureHeights.size() <= texture_name) {
- mTextureHeights.setSize(texture_name + 1);
+ if (mTextureData.size() <= texture_name) {
+ mTextureData.setSize(texture_name + 1);
}
- mTextureWidths.set(texture_name, bitmap.getWidth());
- mTextureHeights.set(texture_name, bitmap.getHeight());
+ TextureData texture_data = new TextureData();
+ texture_data.width = bitmap.getWidth();
+ texture_data.height = bitmap.getHeight();
+ mTextureData.set(texture_name, texture_data);
return texture_name;
}

@@ -669,8 +672,12 @@
private boolean mGlStateInitialized;
private boolean mGlSurfaceInitialized;
private boolean mHasHardwareAcceleration;
- private Vector<Integer> mTextureWidths = new Vector<Integer>();
- private Vector<Integer> mTextureHeights = new Vector<Integer>();
+
+ class TextureData {
+ public int height;
+ public int width;
+ }
+ private Vector<TextureData> mTextureData = new Vector<TextureData>();

// The following matrix definitions are used to avoid any allocations
within
// the draw methods.

Modified: trunk/src/android/com/abb/Map.java
==============================================================================
--- trunk/src/android/com/abb/Map.java (original)
+++ trunk/src/android/com/abb/Map.java Sat Apr 25 20:30:29 2009
@@ -67,15 +67,19 @@
String level_path = Content.getTemporaryFilePath(level_uri);
loadLevelFromFile(level_path);

- // Load tile images.
+ // Load tiles background image.
Uri tiles_uri =
Uri.withAppendedPath(mBaseUri, "tiles_" + mLevelOffset + ".txt");
if (!Content.exists(tiles_uri))
tiles_uri = Uri.withAppendedPath(mBaseUri, "tiles_default.txt");
String tiles_path = Content.getTemporaryFilePath(tiles_uri);
+ String[] image_paths = Content.readFileTokens(tiles_path);
String tiles_image_path = Content.getTemporaryFilePath(
- Uri.withAppendedPath(mBaseUri,
getTilesFromReferenceFile(tiles_path)));
+ Uri.withAppendedPath(mBaseUri, image_paths[0]));
loadTilesFromFile(tiles_image_path);
+ String background_image_path = Content.getTemporaryFilePath(
+ Uri.withAppendedPath(mBaseUri, image_paths[1]));
+ loadBackgroundFromFile(background_image_path);

// Load tile effects.
Uri effects_uri =
@@ -110,23 +114,17 @@
}
}

- public String getTilesFromReferenceFile(String file_path) {
- if (file_path == null) {
- Log.e("Map::loadTilesFromReferenceFile", "Invalid null argument.");
- }
- String[] tiles_file = Content.readFileTokens(file_path);
- Assert.assertEquals("Map::loadTilesFromReferenceFile: Tiles file " +
- "improperly formatted.", tiles_file.length, 1);
- return tiles_file[0];
- }
-
public void loadTilesFromFile(String file_path) {
- if (file_path == null) {
- Log.e("Map::loadTilesFromFile", "Invalid null argument.");
- }
mTilesBitmap = BitmapFactory.decodeFile(file_path);
if (mTilesBitmap == null) {
- Log.e("Map::loadTilesFromFile", "Cannot find: " + file_path);
+ Log.e("Map::loadTilesFromFile", "Cannot find/load: " + file_path);
+ }
+ }
+
+ public void loadBackgroundFromFile(String file_path) {
+ mBackgroundBitmap = BitmapFactory.decodeFile(file_path);
+ if (mBackgroundBitmap == null) {
+ Log.e("Map::loadBackgroundFromFile", "Cannot find/load: " +
file_path);
}
}

@@ -141,12 +139,13 @@
for (int effect = 0; effect < effects_tokens.length; effect += 2) {
int tile_id = Integer.parseInt(effects_tokens[effect]);
String tile_effect = effects_tokens[effect + 1];
- if (tile_effect.equals("death"))
+ if (tile_effect.equals("death")) {
mEffectsDeath[tile_id] = true;
- else if (tile_effect.equals("explode"))
+ } else if (tile_effect.equals("explode")) {
mEffectsExplode[tile_id] = true;
- else if (tile_effect.equals("solid"))
+ } else if (tile_effect.equals("solid")) {
mEffectsSolid[tile_id] = true;;
+ }
}
}

@@ -339,18 +338,30 @@
// Load the textures required for rending here, in the primary thread,
since
// the OpenGL backend requires that all calls be from the same thread
which
// initialized it.
+ if (mBackgroundBitmap != null) {
+ graphics.freeImage(mBackgroundImage);
+ mBackgroundImage = graphics.loadImageFromBitmap(mBackgroundBitmap);
+ mBackgroundBitmap = null;
+ }
if (mTilesBitmap != null) {
graphics.freeImage(mTilesImage);
mTilesImage = graphics.loadImageFromBitmap(mTilesBitmap);
mTilesBitmap = null;
}

- // Draw tiles.
+ // Draw the background.
mRectSource.top = mRectSource.left = 0;
- mRectSource.right = mRectSource.bottom = kTileSize;
-
+ mRectSource.bottom = mRectSource.right = 512;
int canvas_width = graphics.getWidth();
int canvas_height = graphics.getHeight();
+ mRectDest.top = mRectDest.left = 0.0f;
+ mRectDest.right = canvas_width;
+ mRectDest.bottom = canvas_height;
+ graphics.drawImage(mBackgroundImage, mRectSource, mRectDest, false,
false);
+
+ // Draw the tiles.
+ mRectSource.top = mRectSource.left = 0;
+ mRectSource.right = mRectSource.bottom = kTileSize;
int half_canvas_width = canvas_width / 2;
int half_canvas_height = canvas_height / 2;
float x_min = center_x - half_canvas_width / zoom;
@@ -375,7 +386,7 @@
}
}

- // Draw the tile;
+ // Draw the tile.
int tile_id = mTiles[tile_index];
if (tile_id == 0) {
continue; // Not a visual tile.
@@ -434,6 +445,8 @@
return saved_instance_state;
}

+ private Bitmap mBackgroundBitmap;
+ private int mBackgroundImage = -1;
private Uri mBaseUri;
private boolean[] mEffectsDeath;
private boolean[] mEffectsExplode;

Modified: trunk/src/android/com/abb/Weapon.java
==============================================================================
--- trunk/src/android/com/abb/Weapon.java (original)
+++ trunk/src/android/com/abb/Weapon.java Sat Apr 25 20:30:29 2009
@@ -80,7 +80,7 @@

// Now that the user defined weapon parameters have been parsed and
merged,
// we can initialize the weapon instance state accordingly.
- mAmmo = ((Integer)parameters.get(kParameterAmmo)).intValue();
+ mAmmo = mMaxAmmo =
((Integer)parameters.get(kParameterAmmo)).intValue();
mDamage = ((Float)parameters.get(kParameterDamage)).floatValue();
mDelay = ((Float)parameters.get(kParameterDelay)).floatValue();
mProjectileIsFlame =
parameters.get(kParameterProjectileType).equals("flame");
@@ -127,13 +127,14 @@
mPhase += 10.0f;

float shot_angle;
- float shot_distance = 3 * sprite_rect.width() / 4;
+ float shot_distance = sprite_rect.width() / 2;
float shot_velocity = mVelocity;
float x_offset = shot_distance;
float y_offset = -10.0f;

if (!has_ground_contact) {
- shot_angle = 6.28319f * mRandom.nextFloat();
+ shot_angle =
+ (float)Math.atan2(dy, dx) + mSpread * (float)Math.sin(mPhase);
x_offset = shot_distance * (float)Math.cos(shot_angle);
y_offset = shot_distance * (float)Math.sin(shot_angle);
} else {
@@ -143,7 +144,7 @@
float dx_offset = shot_velocity * (float)Math.cos(shot_angle);
float dy_offset = shot_velocity * (float)Math.sin(shot_angle);

- if (sprite_flipped_horizontal) {
+ if (has_ground_contact && sprite_flipped_horizontal) {
x_offset *= -1.0f;
dx_offset *= -1.0f;
}
@@ -209,7 +210,7 @@
private float mDelay;
private static Matrix mDrawingMatrix = new Matrix();
private GameState mGameState;
- private int mMaxAmmo = 25;
+ private int mMaxAmmo;
private float mPhase;
private boolean mProjectileIsFlame;
private Rect mProjectileRect;

Reply all
Reply to author
Forward
0 new messages