Skip to content

Commit c8ee67d

Browse files
committed
voledige tank game
ik heb de tank game aangepast en voledig gemaakt
1 parent 4e43726 commit c8ee67d

12 files changed

+603
-7
lines changed

TankGame.as3proj

+43-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<project>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<project version="2">
33
<!-- Output SWF options -->
44
<output>
5-
<movie disabled="False" />
5+
<movie outputType="Application" />
66
<movie input="" />
7-
<movie path="bin/TankGame.swf" />
7+
<movie path="bin\TankGame.swf" />
88
<movie fps="30" />
99
<movie width="800" />
1010
<movie height="600" />
11-
<movie version="11" />
11+
<movie version="10" />
1212
<movie minorVersion="1" />
13+
<movie platform="Flash Player" />
1314
<movie background="#FFFFFF" />
1415
</output>
1516
<!-- Other classes to be compiled into your SWF -->
@@ -19,31 +20,63 @@
1920
<!-- Build options -->
2021
<build>
2122
<option accessible="False" />
23+
<option advancedTelemetry="False" />
2224
<option allowSourcePathOverlap="False" />
2325
<option benchmark="False" />
2426
<option es="False" />
27+
<option inline="False" />
28+
<option locale="" />
2529
<option loadConfig="" />
2630
<option optimize="True" />
31+
<option omitTraces="True" />
2732
<option showActionScriptWarnings="True" />
2833
<option showBindingWarnings="True" />
34+
<option showInvalidCSS="True" />
2935
<option showDeprecationWarnings="True" />
3036
<option showUnusedTypeSelectorWarnings="True" />
3137
<option strict="True" />
3238
<option useNetwork="True" />
3339
<option useResourceBundleMetadata="True" />
3440
<option warnings="True" />
3541
<option verboseStackTraces="False" />
42+
<option linkReport="" />
43+
<option loadExterns="" />
3644
<option staticLinkRSL="True" />
3745
<option additional="" />
38-
<option customSDK="" />
46+
<option compilerConstants="" />
47+
<option minorVersion="" />
3948
</build>
49+
<!-- SWC Include Libraries -->
50+
<includeLibraries>
51+
<!-- example: <element path="..." /> -->
52+
</includeLibraries>
53+
<!-- SWC Libraries -->
54+
<libraryPaths>
55+
<element path="lib\assets.swc" />
56+
</libraryPaths>
57+
<!-- External Libraries -->
58+
<externalLibraryPaths>
59+
<!-- example: <element path="..." /> -->
60+
</externalLibraryPaths>
61+
<!-- Runtime Shared Libraries -->
62+
<rslPaths>
63+
<!-- example: <element path="..." /> -->
64+
</rslPaths>
65+
<!-- Intrinsic Libraries -->
66+
<intrinsics>
67+
<!-- example: <element path="..." /> -->
68+
</intrinsics>
69+
<!-- Assets to embed into the output SWF -->
70+
<library>
71+
<!-- example: <asset path="..." id="..." update="..." glyphs="..." mode="..." place="..." sharepoint="..." /> -->
72+
</library>
4073
<!-- Class files to compile (other referenced classes will automatically be included) -->
4174
<compileTargets>
4275
<compile path="src\Main.as" />
4376
</compileTargets>
4477
<!-- Paths to exclude from the Project Explorer tree -->
4578
<hiddenPaths>
46-
<!-- example: <hidden path="..." /> -->
79+
<hidden path="obj" />
4780
</hiddenPaths>
4881
<!-- Executed before build -->
4982
<preBuildCommand />
@@ -53,5 +86,8 @@
5386
<options>
5487
<option showHiddenPaths="False" />
5588
<option testMovie="Default" />
89+
<option testMovieCommand="" />
5690
</options>
91+
<!-- Plugin storage -->
92+
<storage />
5793
</project>

bin/TankGame.swf

7.46 KB
Binary file not shown.

lib/assets.swc

3 KB
Binary file not shown.

obj/TankGameConfig.old

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--This Adobe Flex compiler configuration file was generated by a tool.-->
3+
<!--Any modifications you make may be lost.-->
4+
<flex-config>
5+
<target-player>10.1</target-player>
6+
<benchmark>false</benchmark>
7+
<static-link-runtime-shared-libraries>true</static-link-runtime-shared-libraries>
8+
<compiler>
9+
<define append="true">
10+
<name>CONFIG::debug</name>
11+
<value>true</value>
12+
</define>
13+
<define append="true">
14+
<name>CONFIG::release</name>
15+
<value>false</value>
16+
</define>
17+
<define append="true">
18+
<name>CONFIG::timeStamp</name>
19+
<value>'8-12-2014'</value>
20+
</define>
21+
<define append="true">
22+
<name>CONFIG::air</name>
23+
<value>false</value>
24+
</define>
25+
<define append="true">
26+
<name>CONFIG::mobile</name>
27+
<value>false</value>
28+
</define>
29+
<define append="true">
30+
<name>CONFIG::desktop</name>
31+
<value>false</value>
32+
</define>
33+
<verbose-stacktraces>true</verbose-stacktraces>
34+
<source-path append="true">
35+
<path-element>C:\Users\idris dopico peña\Desktop\periode2\dip\WorkInProgress\TankGame\src</path-element>
36+
<path-element>C:\Program Files (x86)\FlashDevelop\Library\AS3\classes</path-element>
37+
</source-path>
38+
<library-path append="true">
39+
<path-element>C:\Users\idris dopico peña\Desktop\periode2\dip\WorkInProgress\TankGame\lib\assets.swc</path-element>
40+
</library-path>
41+
</compiler>
42+
<file-specs>
43+
<path-element>C:\Users\idris dopico peña\Desktop\periode2\dip\WorkInProgress\TankGame\src\Main.as</path-element>
44+
</file-specs>
45+
<default-background-color>#FFFFFF</default-background-color>
46+
<default-frame-rate>30</default-frame-rate>
47+
<default-size>
48+
<width>800</width>
49+
<height>600</height>
50+
</default-size>
51+
</flex-config>

obj/TankGameConfig.xml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--This Adobe Flex compiler configuration file was generated by a tool.-->
3+
<!--Any modifications you make may be lost.-->
4+
<flex-config>
5+
<target-player>10.1</target-player>
6+
<benchmark>false</benchmark>
7+
<static-link-runtime-shared-libraries>true</static-link-runtime-shared-libraries>
8+
<compiler>
9+
<define append="true">
10+
<name>CONFIG::debug</name>
11+
<value>true</value>
12+
</define>
13+
<define append="true">
14+
<name>CONFIG::release</name>
15+
<value>false</value>
16+
</define>
17+
<define append="true">
18+
<name>CONFIG::timeStamp</name>
19+
<value>'8-12-2014'</value>
20+
</define>
21+
<define append="true">
22+
<name>CONFIG::air</name>
23+
<value>false</value>
24+
</define>
25+
<define append="true">
26+
<name>CONFIG::mobile</name>
27+
<value>false</value>
28+
</define>
29+
<define append="true">
30+
<name>CONFIG::desktop</name>
31+
<value>false</value>
32+
</define>
33+
<verbose-stacktraces>true</verbose-stacktraces>
34+
<source-path append="true">
35+
<path-element>C:\Users\idris dopico peña\Desktop\periode2\dip\WorkInProgress\TankGame\src</path-element>
36+
<path-element>C:\Program Files (x86)\FlashDevelop\Library\AS3\classes</path-element>
37+
</source-path>
38+
<library-path append="true">
39+
<path-element>C:\Users\idris dopico peña\Desktop\periode2\dip\WorkInProgress\TankGame\lib\assets.swc</path-element>
40+
</library-path>
41+
</compiler>
42+
<file-specs>
43+
<path-element>C:\Users\idris dopico peña\Desktop\periode2\dip\WorkInProgress\TankGame\src\Main.as</path-element>
44+
</file-specs>
45+
<default-background-color>#FFFFFF</default-background-color>
46+
<default-frame-rate>30</default-frame-rate>
47+
<default-size>
48+
<width>800</width>
49+
<height>600</height>
50+
</default-size>
51+
</flex-config>

src/Bullet.as

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package
2+
{
3+
import flash.display.Sprite;
4+
import flash.geom.Point;
5+
6+
/**
7+
* ...
8+
* @author idris
9+
*/
10+
public class Bullet extends Sprite
11+
{
12+
private var moveX:Number = 0;
13+
private var moveY:Number = 0;
14+
private var speed:Number = 8;
15+
public function Bullet(r:Number, tPos:Point)
16+
{
17+
super();
18+
addChild(new BuletArt());
19+
20+
this.rotation = r;
21+
var radian:Number = r * Math.PI / 180;
22+
moveX = Math.cos(radian);
23+
moveY = Math.sin(radian);
24+
25+
this.x = tPos.x + (66 * moveX);
26+
this.y = tPos.y + (66 * moveY);
27+
28+
}
29+
public function update():void
30+
{
31+
this.x += moveX * speed;
32+
this.y += moveY * speed;
33+
}
34+
35+
}
36+
37+
}

src/Chest.as

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package
2+
{
3+
import flash.display.MovieClip;
4+
import flash.display.Sprite;
5+
/**
6+
* ...
7+
* @author idirs
8+
*/
9+
public class Chest extends Sprite
10+
{
11+
private var chestArt:MovieClip;
12+
public var lives:int = 10;
13+
public function Chest()
14+
{
15+
chestArt = new ChestArt();
16+
addChild(chestArt);
17+
}
18+
19+
}
20+
21+
}

src/EnemyTank.as

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package
2+
{
3+
import flash.events.Event;
4+
import flash.events.TextEvent;
5+
import flash.utils.Timer;
6+
import flash.events.TimerEvent;
7+
/**
8+
* ...
9+
* @author idris
10+
*/
11+
public class EnemyTank extends TankBase
12+
{
13+
private var shootTimer:Timer;
14+
public function EnemyTank()
15+
{
16+
shootTimer = new Timer(1500+Math.random()*1000);
17+
shootTimer.addEventListener(TimerEvent.TIMER, shoot);
18+
shootTimer.start();
19+
}
20+
21+
private function shoot(e:TimerEvent):void
22+
{
23+
var se:ShootEvent = new ShootEvent("onShoot");
24+
se.shooter = this;
25+
dispatchEvent(se);
26+
}
27+
override public function loop(e:Event):void
28+
{
29+
if (Main.tank1 != null)
30+
{
31+
targetPosition.x = Main.tank1.x - this.x;
32+
targetPosition.y = Main.tank1.y - this.y;
33+
}
34+
super.loop(e);
35+
36+
}
37+
override public function destroy():void
38+
{
39+
shootTimer.removeEventListener(TimerEvent.TIMER, shoot);
40+
shootTimer.stop();
41+
shootTimer = null;
42+
super.destroy();
43+
}
44+
45+
}
46+
47+
}

0 commit comments

Comments
 (0)