Compare commits
36 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5b04242aab | |||
| a127777e49 | |||
| 11aea59cf8 | |||
| 5456a01551 | |||
| a93a67161d | |||
| 52a4e44e47 | |||
| 79039ae79e | |||
| 1ae84cf5a8 | |||
| 032fa0c0ad | |||
| 1f8b43ba5d | |||
| 4fc0ae103e | |||
| bd86412d83 | |||
| 592e59e01f | |||
| 05b6fe4a56 | |||
| f68e5d160f | |||
| d279d52b09 | |||
| a1ed498bf5 | |||
| 41c5610f9a | |||
| 5c57454998 | |||
| a7effef412 | |||
| dd1014e230 | |||
| 89ac9fd225 | |||
| 3096fba7c5 | |||
| baf696a3e1 | |||
| 5daf4fafc7 | |||
| db59377cb2 | |||
| 1f6e4fbc3d | |||
| db5b805276 | |||
| 38538b9147 | |||
| 15d830a0d4 | |||
| feb5bafe72 | |||
| b36fd77d74 | |||
| 421f925a60 | |||
| ad4744cfef | |||
| 1c9ccf0fb8 | |||
| e0ceff68f9 |
77
WORK.md
@@ -1,46 +1,73 @@
|
|||||||
* build
|
* build
|
||||||
* gulp 100%
|
* gulp 100%
|
||||||
|
* linux 100%
|
||||||
|
* deb-package 100%
|
||||||
|
* windows 0%
|
||||||
|
* exe-package 0% (inno setup)
|
||||||
|
|
||||||
* deploy
|
* deploy
|
||||||
* capistrano 100%
|
* capistrano 100%
|
||||||
|
|
||||||
* ui
|
* ui
|
||||||
* login frame
|
* auth frame 0%
|
||||||
* select person frame (autoselect)
|
* select game frame 100% (classic 1/2 player, dota singe/coop/vs)
|
||||||
* game mode frame (single, start server, find server)
|
* select level frame 10%
|
||||||
* game frame
|
* game frame 50%
|
||||||
|
|
||||||
* engine
|
* engine
|
||||||
* config 90%
|
* config 100%
|
||||||
* map 80%
|
* map 100%
|
||||||
* tanks 30%
|
* tanks 100%
|
||||||
* bullets 30%
|
* bullets 100%
|
||||||
* boxes 0%
|
* boxes 100%
|
||||||
* map changes 50%
|
* map changes 100%
|
||||||
* bonuses 0%
|
* bonuses 100%
|
||||||
* eagle 0%
|
* eagle 100%
|
||||||
|
|
||||||
* game
|
* game
|
||||||
* classic
|
* classic
|
||||||
* state 0%
|
* state 50%
|
||||||
* bot 5%
|
* bot 50%
|
||||||
* player: 50%
|
* human 100%
|
||||||
|
* dota
|
||||||
|
* state 50%
|
||||||
|
* bot 10%
|
||||||
|
* human 100%
|
||||||
|
|
||||||
|
* bonus
|
||||||
|
* star 50%
|
||||||
|
* grenade 0%
|
||||||
|
* helm 0%
|
||||||
|
* clock 0%
|
||||||
|
* shovel 0%
|
||||||
|
|
||||||
|
* state
|
||||||
|
* score 0%
|
||||||
|
* human tank 0%
|
||||||
|
* save/load 0%
|
||||||
|
* export/import 0%
|
||||||
|
|
||||||
* render
|
* render
|
||||||
* map 100%
|
* map 100%
|
||||||
* tanks 100%
|
* tanks 100%
|
||||||
* bullet 100%
|
* bullet 100%
|
||||||
* calc redraw 20%
|
* calc redraw 50%
|
||||||
* animations
|
* animations
|
||||||
* tank spawn
|
* tank spawn 0%
|
||||||
* bullet boom
|
* tank move 100%
|
||||||
* tank boom
|
* map water 100%
|
||||||
* bonuses
|
* bullet boom 90%
|
||||||
* html5
|
* tank boom 90%
|
||||||
|
* bonuses 100%
|
||||||
|
* html5 50%
|
||||||
|
|
||||||
* proto
|
* proto
|
||||||
|
...
|
||||||
|
|
||||||
|
* editor
|
||||||
* webapp
|
* level
|
||||||
* angular app 0%
|
* open 100%
|
||||||
* google analytics 0%
|
* edit 50%
|
||||||
|
* save 100%
|
||||||
|
* tank
|
||||||
|
* color 10%
|
||||||
@@ -21,7 +21,7 @@ const generate = () => function generate() {
|
|||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
|
|
||||||
const build = (platform) => function build() {
|
const build = (platform, values) => function build() {
|
||||||
const argv = yargs.argv;
|
const argv = yargs.argv;
|
||||||
return gulp.src('.')
|
return gulp.src('.')
|
||||||
.pipe(new Haxe().openfl({
|
.pipe(new Haxe().openfl({
|
||||||
@@ -29,6 +29,7 @@ const build = (platform) => function build() {
|
|||||||
platform: platform,
|
platform: platform,
|
||||||
version: version,
|
version: version,
|
||||||
debug: argv.dev,
|
debug: argv.dev,
|
||||||
|
values: values
|
||||||
}))
|
}))
|
||||||
.pipe(gulp.dest(`target/${platform}`));
|
.pipe(gulp.dest(`target/${platform}`));
|
||||||
};
|
};
|
||||||
@@ -87,6 +88,7 @@ const buildDeb = gulp.series(
|
|||||||
exports['client:flash:html'] = gulp.parallel(flashIndex, flashJs);
|
exports['client:flash:html'] = gulp.parallel(flashIndex, flashJs);
|
||||||
exports['client:flash'] = gulp.series(prepare(Haxe.ID), generate(), build('flash'), exports['client:flash:html']);
|
exports['client:flash'] = gulp.series(prepare(Haxe.ID), generate(), build('flash'), exports['client:flash:html']);
|
||||||
exports['client:html5'] = gulp.series(prepare(Haxe.ID), generate(), build('html5'));
|
exports['client:html5'] = gulp.series(prepare(Haxe.ID), generate(), build('html5'));
|
||||||
|
exports['client:html5-dom'] = gulp.series(prepare(Haxe.ID), generate(), build('html5', {dom:true}));
|
||||||
exports['client:linux'] = gulp.series(prepare(Haxe.ID), generate(), build('linux'));
|
exports['client:linux'] = gulp.series(prepare(Haxe.ID), generate(), build('linux'));
|
||||||
exports['client:webapp'] = webapp;
|
exports['client:webapp'] = webapp;
|
||||||
exports['client:deb'] = buildDeb;
|
exports['client:deb'] = buildDeb;
|
||||||
@@ -108,9 +110,9 @@ const testFlash = function() {
|
|||||||
.pipe(debug());
|
.pipe(debug());
|
||||||
};
|
};
|
||||||
|
|
||||||
const testHtml5 = function() {
|
const testHtml5 = (dom) => function() {
|
||||||
return gulp.series(
|
return gulp.series(
|
||||||
build('html5'),
|
build('html5', {dom:dom}),
|
||||||
() => gulp.src('target/html5').pipe(webserver({
|
() => gulp.src('target/html5').pipe(webserver({
|
||||||
host: 'localhost', port: 3000,
|
host: 'localhost', port: 3000,
|
||||||
open: true,
|
open: true,
|
||||||
@@ -130,7 +132,8 @@ const testLinux = gulp.series(
|
|||||||
|
|
||||||
|
|
||||||
exports['client:flash:test'] = gulp.series(prepare(Haxe.ID, FlashPlayer.ID), testFlash);
|
exports['client:flash:test'] = gulp.series(prepare(Haxe.ID, FlashPlayer.ID), testFlash);
|
||||||
exports['client:html5:test'] = gulp.series(prepare(Haxe.ID), testHtml5);
|
exports['client:html5:test'] = gulp.series(prepare(Haxe.ID), testHtml5());
|
||||||
|
exports['client:html5-dom:test'] = gulp.series(prepare(Haxe.ID), testHtml5(true));
|
||||||
exports['client:linux:test'] = gulp.series(prepare(Haxe.ID), testLinux);
|
exports['client:linux:test'] = gulp.series(prepare(Haxe.ID), testLinux);
|
||||||
exports['client:test'] = exports['client:flash:test'];
|
exports['client:test'] = exports['client:flash:test'];
|
||||||
|
|
||||||
|
|||||||
35
build/editor.js
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
const gulp = require('gulp');
|
||||||
|
const yargs = require('yargs');
|
||||||
|
const Haxe = require('../tasks/haxe');
|
||||||
|
const FlashPlayer = require('../tasks/flashplayer');
|
||||||
|
const version = require('./version');
|
||||||
|
const prepare = require('./prepare');
|
||||||
|
const debug = require('../tasks/debug');
|
||||||
|
|
||||||
|
|
||||||
|
const build = (platform) => function build() {
|
||||||
|
const argv = yargs.argv;
|
||||||
|
return gulp.src('.')
|
||||||
|
.pipe(new Haxe().openfl({
|
||||||
|
command: 'build',
|
||||||
|
platform: platform,
|
||||||
|
version: version,
|
||||||
|
values: {
|
||||||
|
build_editor: true
|
||||||
|
},
|
||||||
|
debug: argv.dev,
|
||||||
|
}))
|
||||||
|
.pipe(gulp.dest(`target/${platform}`));
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const testFlash = function() {
|
||||||
|
const argv = yargs.argv;
|
||||||
|
return build('flash')()
|
||||||
|
.pipe(new FlashPlayer().run(argv.dev))
|
||||||
|
.pipe(debug());
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
exports['editor:flash'] = gulp.series(prepare(Haxe.ID), build('flash'));
|
||||||
|
exports['editor:flash:test'] = gulp.series(prepare(Haxe.ID, FlashPlayer.ID), testFlash);
|
||||||
@@ -29,6 +29,7 @@ const merge = (value) => {
|
|||||||
exports.update = prepare.update;
|
exports.update = prepare.update;
|
||||||
merge('./build/prepare');
|
merge('./build/prepare');
|
||||||
merge('./build/client');
|
merge('./build/client');
|
||||||
|
merge('./build/editor');
|
||||||
merge('./build/server');
|
merge('./build/server');
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "tankz",
|
"name": "tankz",
|
||||||
"version": "0.3.0",
|
"version": "0.7.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"ansi-colors": "^1.0.1",
|
"ansi-colors": "^1.0.1",
|
||||||
@@ -23,6 +23,7 @@
|
|||||||
"plugin-error": "^0.1.2",
|
"plugin-error": "^0.1.2",
|
||||||
"progress": "^2.0.0",
|
"progress": "^2.0.0",
|
||||||
"promise-streams": "^2.1.1",
|
"promise-streams": "^2.1.1",
|
||||||
|
"rmdir": "^1.2.0",
|
||||||
"tar": "^4.2.0",
|
"tar": "^4.2.0",
|
||||||
"tmp-file": "^2.0.1",
|
"tmp-file": "^2.0.1",
|
||||||
"unzip-stream": "^0.2.1",
|
"unzip-stream": "^0.2.1",
|
||||||
@@ -36,6 +37,7 @@
|
|||||||
"protohx": "0.4.6",
|
"protohx": "0.4.6",
|
||||||
"yaml": "1.3.0",
|
"yaml": "1.3.0",
|
||||||
"haxework": "git@bitbucket.org:shmyga/haxework.git",
|
"haxework": "git@bitbucket.org:shmyga/haxework.git",
|
||||||
"orm": "2.1.0"
|
"orm": "2.1.0",
|
||||||
|
"yield": "1.1.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,12 +12,19 @@
|
|||||||
<haxelib name="protohx" version="0.4.6"/>
|
<haxelib name="protohx" version="0.4.6"/>
|
||||||
<haxelib name="haxework" version="git"/>
|
<haxelib name="haxework" version="git"/>
|
||||||
<haxelib name="yaml" version="1.3.0"/>
|
<haxelib name="yaml" version="1.3.0"/>
|
||||||
|
<haxelib name="yield" version="1.1.2"/>
|
||||||
<window fps="30"/>
|
<window fps="30"/>
|
||||||
<window width="1024" height="768" unless="html5"/>
|
<window width="1024" height="768" unless="html5"/>
|
||||||
<haxeflag name="-D" value="swf-gpu"/>
|
<haxeflag name="-D" value="swf-gpu"/>
|
||||||
<haxeflag name="-D" value="native-trace"/>
|
<haxeflag name="-D" value="native-trace"/>
|
||||||
<!--<haxeflag name="-D" value="proto_debug"/>-->
|
<!--<haxeflag name="-D" value="proto_debug"/>-->
|
||||||
<haxeflag name="-dce" value="no"/>
|
<haxeflag name="-dce" value="no"/>
|
||||||
<haxeflag name="-D" value="dom"/>
|
<!--<haxeflag name="-D" value="dom"/>-->
|
||||||
|
<haxeflag name="--macro" value="yield.parser.Parser.auto()"/>
|
||||||
<!--<template path="src/client/webapp/index_template.html" rename="index.html"/>-->
|
<!--<template path="src/client/webapp/index_template.html" rename="index.html"/>-->
|
||||||
|
|
||||||
|
<section if="build_editor">
|
||||||
|
<app main="ru.m.tankz.editor.Editor" path="target" file="editor"/>
|
||||||
|
<source path="src/editor/haxe"/>
|
||||||
|
</section>
|
||||||
</project>
|
</project>
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"pWidth": 100, "pHeight": 100,
|
|
||||||
"views": [
|
|
||||||
{
|
|
||||||
"id": "state", "@type": "haxework.gui.LabelView", "@style": "label",
|
|
||||||
"pWidth": 100, "height": 20
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "render", "@type": "ru.m.tankz.render.Render",
|
|
||||||
"contentSize": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"pWidth": 100, "pHeight": 100,
|
|
||||||
"views": [
|
|
||||||
{
|
|
||||||
"id":"levels", "@type":"haxework.gui.list.VListView<Int>",
|
|
||||||
"factory": "@class:ru.m.tankz.view.frames.list.LevelView",
|
|
||||||
"pWidth":100,
|
|
||||||
"pHeight":100,
|
|
||||||
"paddings":10,
|
|
||||||
"scroll":{
|
|
||||||
"@type":"haxework.gui.list.VScrollView",
|
|
||||||
"width":10, "pHeight":100,
|
|
||||||
"skin":{"@type":"haxework.gui.list.VScrollSkin"}
|
|
||||||
},
|
|
||||||
"skin": {
|
|
||||||
"@type": "haxework.gui.skin.ColorSkin",
|
|
||||||
"color": "0x000000", "alpha": 0.0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
{
|
|
||||||
"pWidth": 100, "pHeight": 100,
|
|
||||||
"views": [
|
|
||||||
{
|
|
||||||
"@type": "haxework.gui.ImageView",
|
|
||||||
"image": "@asset:image:resources/images/logo/logo.png",
|
|
||||||
"contentSize": true, "bottomMargin": 15
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "start_1p",
|
|
||||||
"@type": "haxework.gui.ButtonView",
|
|
||||||
"text": "1 Player",
|
|
||||||
"@style": "button"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "start_2p",
|
|
||||||
"@type": "haxework.gui.ButtonView",
|
|
||||||
"text": "2 Player",
|
|
||||||
"@style": "button"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "dota",
|
|
||||||
"@type": "haxework.gui.ButtonView",
|
|
||||||
"text": "DotA",
|
|
||||||
"@style": "button"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
{
|
|
||||||
"@type": "haxework.gui.VGroupView",
|
|
||||||
"pWidth": 100, "pHeight": 100,
|
|
||||||
"views": [
|
|
||||||
{
|
|
||||||
"id": "switcher", "@type": "haxework.gui.frame.FrameSwitcher",
|
|
||||||
"pWidth": 100, "pHeight": 100,
|
|
||||||
"skin": {
|
|
||||||
"@type": "haxework.gui.skin.BitmapSkin",
|
|
||||||
"image": "@asset:image:resources/images/background.png",
|
|
||||||
"fillType": "REPEAT"
|
|
||||||
},
|
|
||||||
"views": [
|
|
||||||
{
|
|
||||||
"id": "start",
|
|
||||||
"@type": "ru.m.tankz.view.frames.StartFrame"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "level",
|
|
||||||
"@type": "ru.m.tankz.view.frames.LevelFrame"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "game",
|
|
||||||
"@type": "ru.m.tankz.view.frames.GameFrame"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"@type": "haxework.gui.LabelView",
|
|
||||||
"inLayout": false,
|
|
||||||
"contentSize": true,
|
|
||||||
"vAlign": "BOTTOM",
|
|
||||||
"hAlign": "RIGHT",
|
|
||||||
"text": "@res:text:version",
|
|
||||||
"@style": "label"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"level": {
|
|
||||||
"width": 440, "height": 44,
|
|
||||||
"margins": 5,
|
|
||||||
"views": [
|
|
||||||
{
|
|
||||||
"id": "label",
|
|
||||||
"@type": "haxework.gui.LabelView",
|
|
||||||
"pWidth": 100, "pHeight": 100, "text": "",
|
|
||||||
"@style": "label"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"skin": {
|
|
||||||
"@type": "haxework.gui.skin.ColorSkin",
|
|
||||||
"color": "0x000000", "alpha": 0.2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
{
|
|
||||||
"button": {
|
|
||||||
"width":250, "height":60,
|
|
||||||
"skin": {
|
|
||||||
"@type": "haxework.gui.skin.ButtonBitmapSkin",
|
|
||||||
"upImage": "@asset:image:resources/images/control/button_normal.png",
|
|
||||||
"downImage": "@asset:image:resources/images/control/button_down.png",
|
|
||||||
"overImage": "@asset:image:resources/images/control/button_over.png",
|
|
||||||
"fillType": "NINEPATH"
|
|
||||||
},
|
|
||||||
"fontFamily":"@res:text:font", "fontEmbed":true, "fontColor":"0xE7E0BB", "fontSize":20
|
|
||||||
},
|
|
||||||
|
|
||||||
"label": {
|
|
||||||
"fontColor": "0xffffff",
|
|
||||||
"fontEmbed": false,
|
|
||||||
"fontFamily": "@res:text:fontName",
|
|
||||||
"fontSize": 16,
|
|
||||||
"shadowColor": "0x000000"
|
|
||||||
},
|
|
||||||
|
|
||||||
"input": {
|
|
||||||
"fontColor": "0xffffff",
|
|
||||||
"fontEmbed": false,
|
|
||||||
"fontFamily": "@res:text:fontName",
|
|
||||||
"fontSize": 16,
|
|
||||||
"shadowColor": "0x000000",
|
|
||||||
"skin": {
|
|
||||||
"@type": "haxework.gui.skin.ColorSkin",
|
|
||||||
"color": "0x000000"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -6,6 +6,11 @@ import flash.display.Bitmap;
|
|||||||
import flash.display.BitmapData;
|
import flash.display.BitmapData;
|
||||||
|
|
||||||
|
|
||||||
|
typedef Frame = {
|
||||||
|
var image:BitmapData;
|
||||||
|
var length:Int;
|
||||||
|
}
|
||||||
|
|
||||||
class Animate extends Bitmap {
|
class Animate extends Bitmap {
|
||||||
|
|
||||||
private static var timer:Timer;
|
private static var timer:Timer;
|
||||||
@@ -26,24 +31,30 @@ class Animate extends Bitmap {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static var a = new BitmapData(1, 1);
|
|
||||||
|
|
||||||
public var playing(default, set):Bool;
|
public var playing(default, set):Bool;
|
||||||
public var frames(default, set):Array<BitmapData>;
|
public var frames(default, set):Array<Frame>;
|
||||||
|
|
||||||
|
private var sequence:Array<BitmapData>;
|
||||||
private var index:Int;
|
private var index:Int;
|
||||||
|
|
||||||
public function new(?frames:Array<BitmapData>) {
|
public function new(?frames:Array<Frame>) {
|
||||||
super(null, PixelSnapping.AUTO, true);
|
super(null, PixelSnapping.AUTO, true);
|
||||||
this.frames = frames == null ? [] : frames;
|
this.frames = frames == null ? [] : frames;
|
||||||
init();
|
init();
|
||||||
instances.push(this);
|
instances.push(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function set_frames(value:Array<BitmapData>):Array<BitmapData> {
|
public function set_frames(value:Array<Frame>):Array<Frame> {
|
||||||
|
sequence = [];
|
||||||
|
index = 0;
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
frames = value;
|
frames = value;
|
||||||
bitmapData = frames[0];
|
for (frame in frames) {
|
||||||
index = 0;
|
sequence = sequence.concat([for (i in 0...frame.length) frame.image]);
|
||||||
|
}
|
||||||
|
bitmapData = sequence[0];
|
||||||
|
} else {
|
||||||
|
bitmapData = null;
|
||||||
}
|
}
|
||||||
return frames;
|
return frames;
|
||||||
}
|
}
|
||||||
@@ -56,10 +67,10 @@ class Animate extends Bitmap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function update():Void {
|
private function update():Void {
|
||||||
if (++index >= frames.length) {
|
if (++index >= sequence.length) {
|
||||||
index = 0;
|
index = 0;
|
||||||
}
|
}
|
||||||
var nextBitmapData = frames[index];
|
var nextBitmapData = sequence[index];
|
||||||
x -= (nextBitmapData.width - bitmapData.width) / 2;
|
x -= (nextBitmapData.width - bitmapData.width) / 2;
|
||||||
y -= (nextBitmapData.height - bitmapData.height) / 2;
|
y -= (nextBitmapData.height - bitmapData.height) / 2;
|
||||||
bitmapData = nextBitmapData;
|
bitmapData = nextBitmapData;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package ru.m.animate;
|
package ru.m.animate;
|
||||||
|
|
||||||
import promhx.Deferred;
|
import promhx.Deferred;
|
||||||
import flash.display.BitmapData;
|
|
||||||
import promhx.Promise;
|
import promhx.Promise;
|
||||||
|
|
||||||
|
|
||||||
@@ -9,10 +8,6 @@ class OnceAnimate extends Animate {
|
|||||||
|
|
||||||
private var deferred:Deferred<Animate>;
|
private var deferred:Deferred<Animate>;
|
||||||
|
|
||||||
public function new(frames:Array<BitmapData>) {
|
|
||||||
super(frames);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function play():Promise<Animate> {
|
public function play():Promise<Animate> {
|
||||||
deferred = new Deferred();
|
deferred = new Deferred();
|
||||||
playing = true;
|
playing = true;
|
||||||
|
|||||||
17
src/client/haxe/ru/m/draw/BitmapUtil.hx
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
package ru.m.draw;
|
||||||
|
|
||||||
|
import flash.geom.ColorTransform;
|
||||||
|
import flash.geom.Rectangle;
|
||||||
|
import flash.display.BitmapData;
|
||||||
|
|
||||||
|
|
||||||
|
class BitmapUtil {
|
||||||
|
|
||||||
|
public static function colorize(data: BitmapData, color: Color):BitmapData {
|
||||||
|
if (color.zero) return data;
|
||||||
|
var result = data.clone();
|
||||||
|
var transform = new ColorTransform(color.red / 255, color.green / 255, color.blue / 255, 1, 0, 0, 0, 0);
|
||||||
|
result.colorTransform(new Rectangle(0, 0, result.width, result.height), transform);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
47
src/client/haxe/ru/m/draw/Color.hx
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
package ru.m.draw;
|
||||||
|
|
||||||
|
abstract Color(Int) {
|
||||||
|
public var alpha(get, never):Int;
|
||||||
|
public var red(get, never):Int;
|
||||||
|
public var green(get, never):Int;
|
||||||
|
public var blue(get, never):Int;
|
||||||
|
public var zero(get, never):Bool;
|
||||||
|
|
||||||
|
public inline function new(value:Int) {
|
||||||
|
this = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
private inline function get_alpha():Int {
|
||||||
|
return (this >> 24) & 255;
|
||||||
|
}
|
||||||
|
|
||||||
|
private inline function get_red():Int {
|
||||||
|
return (this >> 16) & 255;
|
||||||
|
}
|
||||||
|
|
||||||
|
private inline function get_green():Int {
|
||||||
|
return (this >> 8) & 255;
|
||||||
|
}
|
||||||
|
|
||||||
|
private inline function get_blue():Int {
|
||||||
|
return this & 255;
|
||||||
|
}
|
||||||
|
|
||||||
|
private inline function get_zero():Bool {
|
||||||
|
return this == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@:from
|
||||||
|
static public inline function fromInt(value:Int):Color {
|
||||||
|
return new Color(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@:from
|
||||||
|
static public inline function fromString(value:String):Color {
|
||||||
|
return new Color(Std.parseInt('0x${value.split('#').pop()}'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function toString():String {
|
||||||
|
return 'Color(${red},${green},${blue})';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,34 +1,42 @@
|
|||||||
package ru.m.tankz;
|
package ru.m.tankz;
|
||||||
|
|
||||||
|
import flash.events.KeyboardEvent;
|
||||||
|
import flash.text.Font;
|
||||||
|
import flash.ui.Keyboard;
|
||||||
|
import haxework.gui.ButtonView;
|
||||||
|
import haxework.gui.frame.IFrameSwitcher;
|
||||||
|
import haxework.gui.Root;
|
||||||
|
import haxework.gui.VGroupView;
|
||||||
|
import haxework.gui.ViewBuilder;
|
||||||
|
import haxework.log.TraceLogger;
|
||||||
|
import haxework.provider.Provider;
|
||||||
|
import haxework.resources.IResources;
|
||||||
|
import haxework.resources.Resources;
|
||||||
|
import ru.m.connect.IConnection;
|
||||||
|
import ru.m.tankz.bundle.ConfigBundle;
|
||||||
|
import ru.m.tankz.bundle.IConfigBundle;
|
||||||
|
import ru.m.tankz.bundle.ILevelBundle;
|
||||||
|
import ru.m.tankz.bundle.LevelBundle;
|
||||||
|
import ru.m.tankz.frame.StartFrame;
|
||||||
import ru.m.tankz.game.ClassicGame;
|
import ru.m.tankz.game.ClassicGame;
|
||||||
import ru.m.tankz.game.DotaGame;
|
import ru.m.tankz.game.DotaGame;
|
||||||
import ru.m.tankz.game.Game;
|
import ru.m.tankz.game.Game;
|
||||||
import flash.ui.Keyboard;
|
|
||||||
import flash.events.KeyboardEvent;
|
|
||||||
import flash.text.Font;
|
|
||||||
import ru.m.tankz.view.frames.StartFrame;
|
|
||||||
import haxework.log.SocketLogger;
|
|
||||||
import haxework.resources.Resources;
|
|
||||||
import haxework.resources.IResources;
|
|
||||||
import haxework.gui.VGroupView;
|
|
||||||
import haxework.gui.ViewBuilder;
|
|
||||||
import haxework.gui.ButtonView;
|
|
||||||
import ru.m.tankz.PacketBuilder;
|
import ru.m.tankz.PacketBuilder;
|
||||||
import haxework.log.JSLogger;
|
import ru.m.tankz.storage.SaveStorage;
|
||||||
import haxework.gui.frame.IFrameSwitcher;
|
#if flash import haxework.log.JSLogger; #end
|
||||||
import haxework.provider.Provider;
|
#if debug import haxework.log.SocketLogger; #end
|
||||||
import haxework.gui.frame.FrameSwitcher;
|
|
||||||
import haxework.gui.Root;
|
|
||||||
import openfl.Assets;
|
|
||||||
import ru.m.connect.IConnection;
|
|
||||||
import haxework.log.TraceLogger;
|
|
||||||
|
|
||||||
@:template("layout/main.json", "layout/styles.json")
|
|
||||||
class MainView extends VGroupView implements ViewBuilder {}
|
interface ClientViewLayout {
|
||||||
|
var switcher(default, null):IFrameSwitcher;
|
||||||
|
}
|
||||||
|
|
||||||
|
@:template('ru/m/tankz/Client.yaml', 'ru/m/tankz/Style.yaml')
|
||||||
|
class ClientView extends VGroupView implements ClientViewLayout implements ViewBuilder {}
|
||||||
|
|
||||||
class Client implements IConnectionHandler {
|
class Client implements IConnectionHandler {
|
||||||
|
|
||||||
private static inline var TAG = "Tankz";
|
private static inline var TAG = 'Tankz';
|
||||||
|
|
||||||
public static function main() {
|
public static function main() {
|
||||||
L.push(new TraceLogger());
|
L.push(new TraceLogger());
|
||||||
@@ -39,36 +47,35 @@ class Client implements IConnectionHandler {
|
|||||||
L.push(new SocketLogger());
|
L.push(new SocketLogger());
|
||||||
#end
|
#end
|
||||||
Const.init();
|
Const.init();
|
||||||
L.d(TAG, "Debug: " + Const.DEBUG);
|
L.d(TAG, 'Debug: ${Const.DEBUG}');
|
||||||
L.i(TAG, "Version: " + Const.VERSION);
|
L.i(TAG, 'Version: ${Const.VERSION}');
|
||||||
L.i(TAG, "Build: " + Const.BUILD);
|
L.i(TAG, 'Build: ${Const.BUILD}');
|
||||||
new Client();
|
new Client();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private var view:MainView;
|
private var view:ClientView;
|
||||||
|
|
||||||
public function new() {
|
public function new() {
|
||||||
Provider.setFactory(IResources, Resources);
|
Provider.setFactory(IResources, Resources);
|
||||||
|
|
||||||
var font:Font = Font.enumerateFonts()[0];
|
var font:Font = Font.enumerateFonts()[0];
|
||||||
Provider.get(IResources).text.put("font", "Bookman Old Style");
|
Provider.get(IResources).text.put('font', 'Bookman Old Style');
|
||||||
Provider.get(IResources).text.put("version", 'v${Const.VERSION} b${Const.BUILD}');
|
Provider.get(IResources).text.put('version', 'v${Const.VERSION} b${Const.BUILD}');
|
||||||
|
|
||||||
Provider.set(IPacketBuilder, new PacketBuilder());
|
Provider.set(IPacketBuilder, new PacketBuilder());
|
||||||
#if flash
|
#if flash
|
||||||
Provider.set(IConnection, new ru.m.connect.flash.FlashConnection("localhost", 5001));
|
Provider.set(IConnection, new ru.m.connect.flash.FlashConnection('localhost', 5001));
|
||||||
#elseif html5
|
#elseif html5
|
||||||
Provider.set(IConnection, new ru.m.connect.js.JsConnection("localhost", 5001));
|
Provider.set(IConnection, new ru.m.connect.js.JsConnection('localhost', 5001));
|
||||||
#end
|
#end
|
||||||
|
|
||||||
//Provider.get(IConnection).handler.addListener(this);
|
//Provider.get(IConnection).handler.addListener(this);
|
||||||
view = new MainView();
|
view = new ClientView();
|
||||||
Provider.set(IFrameSwitcher, view.switcher);
|
Provider.set(IFrameSwitcher, view.switcher);
|
||||||
Root.bind(view);
|
Root.bind(view);
|
||||||
view.content.stage.stageFocusRect = false;
|
view.content.stage.stageFocusRect = false;
|
||||||
//view.logout.onPress = this;
|
//view.logout.onPress = this;
|
||||||
view.switcher.change(StartFrame.ID);
|
|
||||||
|
|
||||||
view.content.stage.addEventListener(KeyboardEvent.KEY_UP, function(event:KeyboardEvent):Void {
|
view.content.stage.addEventListener(KeyboardEvent.KEY_UP, function(event:KeyboardEvent):Void {
|
||||||
if (event.keyCode == Keyboard.ESCAPE) {
|
if (event.keyCode == Keyboard.ESCAPE) {
|
||||||
@@ -76,13 +83,18 @@ class Client implements IConnectionHandler {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Provider.setFactory(IConfigBundle, ConfigBundle);
|
||||||
|
Provider.setFactory(ILevelBundle, LevelBundle);
|
||||||
|
Provider.setFactory(SaveStorage, SaveStorage);
|
||||||
Provider.setFactory(Game, ClassicGame, ClassicGame.TYPE);
|
Provider.setFactory(Game, ClassicGame, ClassicGame.TYPE);
|
||||||
Provider.setFactory(Game, DotaGame, DotaGame.TYPE);
|
Provider.setFactory(Game, DotaGame, DotaGame.TYPE);
|
||||||
|
|
||||||
|
view.switcher.change(StartFrame.ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onPress(view:ButtonView):Void {
|
public function onPress(view:ButtonView):Void {
|
||||||
switch (view.id) {
|
switch (view.id) {
|
||||||
case "logout":
|
case 'logout':
|
||||||
Provider.get(IConnection).disconnect();
|
Provider.get(IConnection).disconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -94,7 +106,7 @@ class Client implements IConnectionHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function onError(error:Dynamic):Void {
|
public function onError(error:Dynamic):Void {
|
||||||
L.e(TAG, "", error);
|
L.e(TAG, '', error);
|
||||||
//view.switcher.change(AuthFrame.ID);
|
//view.switcher.change(AuthFrame.ID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
27
src/client/haxe/ru/m/tankz/Client.yaml
Executable file
@@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
$type: haxework.gui.VGroupView
|
||||||
|
pWidth: 100
|
||||||
|
pHeight: 100
|
||||||
|
views:
|
||||||
|
- id: switcher
|
||||||
|
$type: haxework.gui.frame.FrameSwitcher
|
||||||
|
pWidth: 100
|
||||||
|
pHeight: 100
|
||||||
|
skin:
|
||||||
|
$type: haxework.gui.skin.BitmapSkin
|
||||||
|
image: "@asset:image:resources/image/ui/background.png"
|
||||||
|
fillType: REPEAT
|
||||||
|
views:
|
||||||
|
- id: start
|
||||||
|
$type: ru.m.tankz.frame.StartFrame
|
||||||
|
- id: level
|
||||||
|
$type: ru.m.tankz.frame.LevelFrame
|
||||||
|
- id: game
|
||||||
|
$type: ru.m.tankz.frame.GameFrame
|
||||||
|
- $type: haxework.gui.LabelView
|
||||||
|
$style: label
|
||||||
|
inLayout: false
|
||||||
|
contentSize: true
|
||||||
|
vAlign: BOTTOM
|
||||||
|
hAlign: RIGHT
|
||||||
|
text: "@res:text:version"
|
||||||
21
src/client/haxe/ru/m/tankz/Style.yaml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
button:
|
||||||
|
width: 250
|
||||||
|
height: 60
|
||||||
|
skin:
|
||||||
|
$type: haxework.gui.skin.ButtonBitmapSkin
|
||||||
|
upImage: "@asset:image:resources/image/ui/button/normal.png"
|
||||||
|
downImage: "@asset:image:resources/image/ui/button/down.png"
|
||||||
|
overImage: "@asset:image:resources/image/ui/button/over.png"
|
||||||
|
fillType: NINEPATH
|
||||||
|
fontFamily: "@res:text:font"
|
||||||
|
fontEmbed: true
|
||||||
|
fontColor: "#E7E0BB"
|
||||||
|
fontSize: 20
|
||||||
|
|
||||||
|
label:
|
||||||
|
fontColor: "#ffffff"
|
||||||
|
fontEmbed: false
|
||||||
|
fontFamily: Courirer New
|
||||||
|
fontSize: 16
|
||||||
|
shadowColor: 0x000000
|
||||||
30
src/client/haxe/ru/m/tankz/bundle/ConfigBundle.hx
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
package ru.m.tankz.bundle;
|
||||||
|
|
||||||
|
import openfl.Assets;
|
||||||
|
import ru.m.tankz.config.Config;
|
||||||
|
import ru.m.tankz.Type;
|
||||||
|
import yaml.Parser;
|
||||||
|
import yaml.Yaml;
|
||||||
|
|
||||||
|
|
||||||
|
typedef ConfigSource = {
|
||||||
|
var game:GameConfig;
|
||||||
|
var map: MapConfig;
|
||||||
|
var bricks: Array<BrickConfig>;
|
||||||
|
var presets: Array<GamePreset>;
|
||||||
|
var points: Array<SpawnPoint>;
|
||||||
|
var tanks: Array<TankConfig>;
|
||||||
|
var bonuses: Array<BonusConfig>;
|
||||||
|
}
|
||||||
|
|
||||||
|
class ConfigBundle implements IConfigBundle {
|
||||||
|
|
||||||
|
private static function convert(raw:Dynamic):ConfigSource {
|
||||||
|
return raw;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get(type:GameType):Config {
|
||||||
|
var source = convert(Yaml.parse(Assets.getText('resources/${type}/config.yaml'), Parser.options().useObjects()));
|
||||||
|
return new Config(type, source.game, source.map, source.bricks, source.presets, source.points, source.tanks, source.bonuses);
|
||||||
|
}
|
||||||
|
}
|
||||||
15
src/client/haxe/ru/m/tankz/bundle/LevelBundle.hx
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
package ru.m.tankz.bundle;
|
||||||
|
|
||||||
|
import openfl.Assets;
|
||||||
|
import ru.m.tankz.config.Config;
|
||||||
|
import ru.m.tankz.Type;
|
||||||
|
import ru.m.tankz.util.LevelUtil;
|
||||||
|
|
||||||
|
|
||||||
|
class LevelBundle implements ILevelBundle {
|
||||||
|
|
||||||
|
public function get(type:GameType, config:Config, level:Int):LevelConfig {
|
||||||
|
var data:String = Assets.getText('resources/${type}/levels/level${LevelUtil.formatLevel(level)}.txt');
|
||||||
|
return LevelUtil.loads(config, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,27 +1,26 @@
|
|||||||
package ru.m.tankz.control;
|
package ru.m.tankz.control;
|
||||||
|
|
||||||
import ru.m.tankz.control.Control;
|
|
||||||
import haxe.Timer;
|
|
||||||
import ru.m.geom.Direction;
|
|
||||||
import flash.events.FocusEvent;
|
import flash.events.FocusEvent;
|
||||||
import flash.ui.Keyboard;
|
|
||||||
import flash.events.KeyboardEvent;
|
import flash.events.KeyboardEvent;
|
||||||
import flash.Lib;
|
import flash.Lib;
|
||||||
|
import flash.ui.Keyboard;
|
||||||
|
import haxe.Timer;
|
||||||
|
import ru.m.geom.Direction;
|
||||||
|
import ru.m.tankz.control.Control;
|
||||||
|
import ru.m.tankz.Type;
|
||||||
|
|
||||||
|
|
||||||
typedef KeyBinding = Map<Int, TankAction>;
|
typedef KeyBinding = Map<Int, TankAction>;
|
||||||
|
|
||||||
|
|
||||||
class HumanControl extends Control {
|
class HumanControl extends Control {
|
||||||
public static var TYPE(default, never):ControlType = 'human';
|
|
||||||
|
|
||||||
private var keyBinding:KeyBinding;
|
private var keyBinding:KeyBinding;
|
||||||
private var moveQueue:Array<Int>;
|
private var moveQueue:Array<Int>;
|
||||||
private var shotTimer:Timer;
|
private var shotTimer:Timer;
|
||||||
|
|
||||||
public function new(index:Int) {
|
public function new(playerId:PlayerId, controlIndex:Int) {
|
||||||
super({type:TYPE, index:index});
|
super(playerId);
|
||||||
this.keyBinding = resolve(index);
|
this.keyBinding = resolve(controlIndex);
|
||||||
moveQueue = new Array<Int>();
|
moveQueue = new Array<Int>();
|
||||||
Lib.current.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
|
Lib.current.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
|
||||||
Lib.current.stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
|
Lib.current.stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
|
||||||
@@ -44,7 +43,7 @@ class HumanControl extends Control {
|
|||||||
case _:
|
case _:
|
||||||
}
|
}
|
||||||
if (event.keyCode == Keyboard.U) {
|
if (event.keyCode == Keyboard.U) {
|
||||||
action(TankAction.LEVEL_UP(1));
|
action(TankAction.UPGRADE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,8 +82,8 @@ class HumanControl extends Control {
|
|||||||
action(TankAction.SHOT);
|
action(TankAction.SHOT);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function resolve(index:Int):KeyBinding {
|
private static function resolve(controlIndex:Int):KeyBinding {
|
||||||
switch (index) {
|
switch (controlIndex) {
|
||||||
case 0:
|
case 0:
|
||||||
return [
|
return [
|
||||||
Keyboard.A => TankAction.MOVE(Direction.LEFT),
|
Keyboard.A => TankAction.MOVE(Direction.LEFT),
|
||||||
@@ -101,8 +100,8 @@ class HumanControl extends Control {
|
|||||||
Keyboard.RIGHT => TankAction.MOVE(Direction.RIGHT),
|
Keyboard.RIGHT => TankAction.MOVE(Direction.RIGHT),
|
||||||
Keyboard.NUMPAD_0 => TankAction.SHOT
|
Keyboard.NUMPAD_0 => TankAction.SHOT
|
||||||
];
|
];
|
||||||
case _:
|
case x:
|
||||||
throw 'Invalid control index ${index}';
|
throw 'Invalid control index ${x}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
package ru.m.tankz.view.frames;
|
package ru.m.tankz.frame;
|
||||||
|
|
||||||
import haxe.ds.Option;
|
|
||||||
import haxe.ds.Option;
|
|
||||||
import flash.events.Event;
|
import flash.events.Event;
|
||||||
|
import haxe.ds.Option;
|
||||||
import haxe.Timer;
|
import haxe.Timer;
|
||||||
import haxework.gui.frame.IFrameSwitcher;
|
import haxework.gui.frame.IFrameSwitcher;
|
||||||
import haxework.gui.LabelView;
|
import haxework.gui.LabelView;
|
||||||
@@ -12,9 +11,11 @@ import haxework.provider.Provider;
|
|||||||
import protohx.Message;
|
import protohx.Message;
|
||||||
import ru.m.connect.IConnection;
|
import ru.m.connect.IConnection;
|
||||||
import ru.m.tankz.game.Game;
|
import ru.m.tankz.game.Game;
|
||||||
|
import ru.m.tankz.game.GameSave;
|
||||||
import ru.m.tankz.game.GameState;
|
import ru.m.tankz.game.GameState;
|
||||||
import ru.m.tankz.proto.pack.GameUpdateResponse;
|
import ru.m.tankz.proto.pack.GameUpdateResponse;
|
||||||
import ru.m.tankz.render.Render;
|
import ru.m.tankz.render.Render;
|
||||||
|
import ru.m.tankz.storage.SaveStorage;
|
||||||
|
|
||||||
|
|
||||||
interface GameFrameLayout {
|
interface GameFrameLayout {
|
||||||
@@ -22,8 +23,7 @@ interface GameFrameLayout {
|
|||||||
var render(default, null):Render;
|
var render(default, null):Render;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@:template("ru/m/tankz/frame/GameFrame.yaml", "ru/m/tankz/Style.yaml")
|
||||||
@:template("layout/frames/game.json", "layout/styles.json")
|
|
||||||
class GameFrame extends VGroupView implements ViewBuilder implements IPacketHandler implements GameFrameLayout {
|
class GameFrame extends VGroupView implements ViewBuilder implements IPacketHandler implements GameFrameLayout {
|
||||||
|
|
||||||
private static inline var TAG = "GameFrame";
|
private static inline var TAG = "GameFrame";
|
||||||
@@ -36,22 +36,22 @@ class GameFrame extends VGroupView implements ViewBuilder implements IPacketHand
|
|||||||
public function init():Void {}
|
public function init():Void {}
|
||||||
|
|
||||||
public function onShow():Void {
|
public function onShow():Void {
|
||||||
start(Provider.get(GameState));
|
start(Provider.get(GameSave));
|
||||||
}
|
}
|
||||||
|
|
||||||
private function start(s:GameState):Void {
|
private function start(save:GameSave):Void {
|
||||||
game = Provider.build(Game, s.type);
|
game = Provider.build(Game, save.state.type);
|
||||||
if (game == null) {
|
if (game == null) {
|
||||||
throw 'Unsupported game type "${s.type}"';
|
throw 'Unsupported game type "${save.state.type}"';
|
||||||
}
|
}
|
||||||
game.engine.listeners.push(render);
|
game.engine.listeners.push(render);
|
||||||
game.start(s).then(onGameStateChange).endThen(onGameComplete);
|
game.start(save).then(onGameStateChange).endThen(onGameComplete);
|
||||||
content.addEventListener(Event.ENTER_FRAME, redraw);
|
content.addEventListener(Event.ENTER_FRAME, redraw);
|
||||||
//Provider.get(IConnection).packetHandler.addListener(this);
|
//Provider.get(IConnection).packetHandler.addListener(this);
|
||||||
render.draw(game.engine);
|
render.draw(game.engine);
|
||||||
timer = new Timer(10);
|
timer = new Timer(10);
|
||||||
timer.run = updateEngine;
|
timer.run = updateEngine;
|
||||||
state.text = stateString(s);
|
state.text = stateString(game);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function stop():Void {
|
private function stop():Void {
|
||||||
@@ -68,20 +68,21 @@ class GameFrame extends VGroupView implements ViewBuilder implements IPacketHand
|
|||||||
render.reset();
|
render.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function stateString(state:GameState):String {
|
private function stateString(game:Game):String {
|
||||||
|
if (game.state == null) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
var result:Array<String> = [];
|
var result:Array<String> = [];
|
||||||
result.push('Level: ${state.level}');
|
result.push('Level: ${game.state.level}');
|
||||||
for (teamId in state.teams.keys()) {
|
for (team in game.teams) {
|
||||||
var ts:TeamState = state.teams[teamId];
|
if (game.state.loser == team.id) {
|
||||||
if (ts.lose) {
|
result.push('${team.id}: LOSE');
|
||||||
result.push('${teamId}: LOSE');
|
} else if (team.life > -1) {
|
||||||
} else if (ts.life > -1) {
|
result.push('${team.id}: ${team.life}');
|
||||||
result.push('${teamId}: ${ts.life}');
|
|
||||||
} else {
|
} else {
|
||||||
for (index in ts.players.keys()) {
|
for (player in team.players) {
|
||||||
var ps:PlayerState = ts.players[index];
|
if (player.life > -1) {
|
||||||
if (ps.life > -1) {
|
result.push('${player.id.team}${player.id.index}: ${player.life}');
|
||||||
result.push('${teamId}${index}: ${ps.life}');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -90,20 +91,22 @@ class GameFrame extends VGroupView implements ViewBuilder implements IPacketHand
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function onGameStateChange(s:GameState):GameState {
|
private function onGameStateChange(s:GameState):GameState {
|
||||||
state.text = stateString(s);
|
state.text = stateString(game);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function onGameComplete(result:Option<GameState>):Void {
|
private function onGameComplete(result:Option<GameState>):Void {
|
||||||
switch (result) {
|
switch (result) {
|
||||||
case Option.Some(s):
|
case Option.Some(s):
|
||||||
state.text = stateString(s);
|
state.text = stateString(game);
|
||||||
case Option.None:
|
case Option.None:
|
||||||
}
|
}
|
||||||
switch (game.next()) {
|
switch (game.next()) {
|
||||||
case Option.Some(s):
|
case Option.Some(s):
|
||||||
|
var save = game.save();
|
||||||
|
Provider.get(SaveStorage).write(save);
|
||||||
stop();
|
stop();
|
||||||
start(s);
|
start(save);
|
||||||
case Option.None:
|
case Option.None:
|
||||||
Provider.get(IFrameSwitcher).change(StartFrame.ID);
|
Provider.get(IFrameSwitcher).change(StartFrame.ID);
|
||||||
}
|
}
|
||||||
12
src/client/haxe/ru/m/tankz/frame/GameFrame.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
pWidth: 100
|
||||||
|
pHeight: 100
|
||||||
|
views:
|
||||||
|
- id: state
|
||||||
|
$type: haxework.gui.LabelView
|
||||||
|
$style: label
|
||||||
|
pWidth: 100
|
||||||
|
height: 20
|
||||||
|
- id: render
|
||||||
|
$type: ru.m.tankz.render.Render
|
||||||
|
contentSize: true
|
||||||
@@ -1,12 +1,13 @@
|
|||||||
package ru.m.tankz.view.frames;
|
package ru.m.tankz.frame;
|
||||||
|
|
||||||
import ru.m.tankz.config.ConfigBundle;
|
import ru.m.tankz.game.GameSave;
|
||||||
import haxework.gui.frame.IFrameSwitcher;
|
import haxework.gui.frame.IFrameSwitcher;
|
||||||
import ru.m.tankz.game.GameState;
|
|
||||||
import haxework.provider.Provider;
|
|
||||||
import haxework.gui.list.ListView;
|
import haxework.gui.list.ListView;
|
||||||
import haxework.gui.ViewBuilder;
|
|
||||||
import haxework.gui.VGroupView;
|
import haxework.gui.VGroupView;
|
||||||
|
import haxework.gui.ViewBuilder;
|
||||||
|
import haxework.provider.Provider;
|
||||||
|
import ru.m.tankz.bundle.IConfigBundle;
|
||||||
|
import ru.m.tankz.game.GameState;
|
||||||
|
|
||||||
|
|
||||||
interface LevelFrameLayout {
|
interface LevelFrameLayout {
|
||||||
@@ -14,8 +15,8 @@ interface LevelFrameLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@:template("layout/frames/level.json", "layout/styles.json")
|
@:template("ru/m/tankz/frame/LevelFrame.yaml", "ru/m/tankz/Style.yaml")
|
||||||
class LevelFrame extends VGroupView implements ViewBuilder implements LevelFrameLayout implements ListViewListener<Int> {
|
class LevelFrame extends VGroupView implements ViewBuilder implements LevelFrameLayout {
|
||||||
public static inline var ID = "level";
|
public static inline var ID = "level";
|
||||||
|
|
||||||
public function init():Void {
|
public function init():Void {
|
||||||
@@ -23,13 +24,13 @@ class LevelFrame extends VGroupView implements ViewBuilder implements LevelFrame
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function onShow():Void {
|
public function onShow():Void {
|
||||||
var state = Provider.get(GameState);
|
var state:GameState = Provider.get(GameSave).state;
|
||||||
var c = ConfigBundle.get(state.type).game.levels;
|
var c = Provider.get(IConfigBundle).get(state.type).game.levels;
|
||||||
levels.data = [for (i in 0...c) i];
|
levels.data = [for (i in 0...c) i];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onListItemClick(item:IListItemView<Int>):Void {
|
public function onListItemClick(item:IListItemView<Int>):Void {
|
||||||
Provider.get(GameState).level = item.data;
|
Provider.get(GameSave).state.level = item.data;
|
||||||
Provider.get(IFrameSwitcher).change(GameFrame.ID);
|
Provider.get(IFrameSwitcher).change(GameFrame.ID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
20
src/client/haxe/ru/m/tankz/frame/LevelFrame.yaml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
pWidth: 100
|
||||||
|
pHeight: 100
|
||||||
|
views:
|
||||||
|
- id: levels
|
||||||
|
$type: haxework.gui.list.VListView<Int>
|
||||||
|
factory: "@class:ru.m.tankz.frame.level.LevelView"
|
||||||
|
pWidth: 100
|
||||||
|
pHeight: 100
|
||||||
|
paddings: 10
|
||||||
|
scroll:
|
||||||
|
$type: haxework.gui.list.VScrollView
|
||||||
|
width: 10
|
||||||
|
pHeight: 100
|
||||||
|
skin:
|
||||||
|
$type: haxework.gui.list.VScrollSkin
|
||||||
|
skin:
|
||||||
|
$type: haxework.gui.skin.ColorSkin
|
||||||
|
color: "#000000"
|
||||||
|
alpha: 0
|
||||||
70
src/client/haxe/ru/m/tankz/frame/StartFrame.hx
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
package ru.m.tankz.frame;
|
||||||
|
|
||||||
|
import ru.m.tankz.storage.SaveStorage;
|
||||||
|
import ru.m.tankz.game.GameSave;
|
||||||
|
import haxework.gui.ButtonView;
|
||||||
|
import haxework.gui.frame.IFrameSwitcher;
|
||||||
|
import haxework.gui.VGroupView;
|
||||||
|
import haxework.gui.ViewBuilder;
|
||||||
|
import haxework.provider.Provider;
|
||||||
|
import ru.m.tankz.game.ClassicGame;
|
||||||
|
import ru.m.tankz.game.DotaGame;
|
||||||
|
import ru.m.tankz.game.GameState;
|
||||||
|
import ru.m.tankz.Type;
|
||||||
|
|
||||||
|
|
||||||
|
interface StartFrameLayout {
|
||||||
|
var classic_1p(default, null):ButtonView;
|
||||||
|
var classic_2p(default, null):ButtonView;
|
||||||
|
var classic_load(default, null):ButtonView;
|
||||||
|
var dota_1p(default, null):ButtonView;
|
||||||
|
var dota_2p_coop(default, null):ButtonView;
|
||||||
|
var dota_2p_vs(default, null):ButtonView;
|
||||||
|
}
|
||||||
|
|
||||||
|
@:template("ru/m/tankz/frame/StartFrame.yaml", "ru/m/tankz/Style.yaml")
|
||||||
|
class StartFrame extends VGroupView implements ViewBuilder implements StartFrameLayout {
|
||||||
|
|
||||||
|
public static inline var ID = "start";
|
||||||
|
|
||||||
|
public function init():Void {
|
||||||
|
classic_1p.onPress = this;
|
||||||
|
classic_2p.onPress = this;
|
||||||
|
classic_load.onPress = this;
|
||||||
|
dota_1p.onPress = this;
|
||||||
|
dota_2p_coop.onPress = this;
|
||||||
|
dota_2p_vs.onPress = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function onShow():Void {
|
||||||
|
classic_load.visible = Provider.get(SaveStorage).read(ClassicGame.TYPE) != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function onPress(view:ButtonView):Void {
|
||||||
|
switch (view.id) {
|
||||||
|
case 'classic_1p':
|
||||||
|
startGame(ClassicGame.TYPE, ClassicGame.PLAYER1);
|
||||||
|
case 'classic_2p':
|
||||||
|
startGame(ClassicGame.TYPE, ClassicGame.PLAYER2);
|
||||||
|
case 'classic_load':
|
||||||
|
loadGame(ClassicGame.TYPE);
|
||||||
|
case 'dota_1p':
|
||||||
|
startGame(DotaGame.TYPE, DotaGame.PLAYER1);
|
||||||
|
case 'dota_2p_coop':
|
||||||
|
startGame(DotaGame.TYPE, DotaGame.PLAYER2_COOP);
|
||||||
|
case 'dota_2p_vs':
|
||||||
|
startGame(DotaGame.TYPE, DotaGame.PLAYER2_VS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function startGame(type:GameType, presetId:PresetId):Void {
|
||||||
|
Provider.set(GameSave, new GameSave({type: type, presetId: presetId}));
|
||||||
|
Provider.get(IFrameSwitcher).change(LevelFrame.ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function loadGame(type:GameType):Void {
|
||||||
|
var save:GameSave = Provider.get(SaveStorage).read(type);
|
||||||
|
Provider.set(GameSave, save);
|
||||||
|
Provider.get(IFrameSwitcher).change(GameFrame.ID);
|
||||||
|
}
|
||||||
|
}
|
||||||
44
src/client/haxe/ru/m/tankz/frame/StartFrame.yaml
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
---
|
||||||
|
pWidth: 100
|
||||||
|
pHeight: 100
|
||||||
|
views:
|
||||||
|
- $type: haxework.gui.ImageView
|
||||||
|
image: "@asset:image:resources/image/ui/logo.png"
|
||||||
|
contentSize: true
|
||||||
|
bottomMargin: 15
|
||||||
|
- $type: haxework.gui.LabelView
|
||||||
|
$style: label
|
||||||
|
fontSize: 20
|
||||||
|
topMargin: 15
|
||||||
|
contentSize: true
|
||||||
|
text: Classic
|
||||||
|
- id: classic_1p
|
||||||
|
$type: haxework.gui.ButtonView
|
||||||
|
text: 1 Player
|
||||||
|
$style: button
|
||||||
|
- id: classic_2p
|
||||||
|
$type: haxework.gui.ButtonView
|
||||||
|
text: 2 Player
|
||||||
|
$style: button
|
||||||
|
- id: classic_load
|
||||||
|
$type: haxework.gui.ButtonView
|
||||||
|
text: Load
|
||||||
|
$style: button
|
||||||
|
- $type: haxework.gui.LabelView
|
||||||
|
$style: label
|
||||||
|
fontSize: 20
|
||||||
|
topMargin: 15
|
||||||
|
contentSize: true
|
||||||
|
text: DotA
|
||||||
|
- id: dota_1p
|
||||||
|
$type: haxework.gui.ButtonView
|
||||||
|
text: 1 Player
|
||||||
|
$style: button
|
||||||
|
- id: dota_2p_coop
|
||||||
|
$type: haxework.gui.ButtonView
|
||||||
|
text: 2 COOP
|
||||||
|
$style: button
|
||||||
|
- id: dota_2p_vs
|
||||||
|
$type: haxework.gui.ButtonView
|
||||||
|
text: 2 VS
|
||||||
|
$style: button
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package ru.m.tankz.view.frames.list;
|
package ru.m.tankz.frame.level;
|
||||||
|
|
||||||
import haxework.gui.ViewBuilder;
|
import haxework.gui.ViewBuilder;
|
||||||
import haxework.gui.HGroupView;
|
import haxework.gui.HGroupView;
|
||||||
@@ -10,7 +10,7 @@ interface LevelViewLayout {
|
|||||||
var label(default, null):LabelView;
|
var label(default, null):LabelView;
|
||||||
}
|
}
|
||||||
|
|
||||||
@:template("layout/other.json@level", "layout/styles.json")
|
@:template("ru/m/tankz/frame/level/LevelView.yaml", "ru/m/tankz/Style.yaml")
|
||||||
class LevelView extends HGroupView implements ViewBuilder implements IListItemView<Int> implements LevelViewLayout {
|
class LevelView extends HGroupView implements ViewBuilder implements IListItemView<Int> implements LevelViewLayout {
|
||||||
|
|
||||||
public var item_index(default, default):Int;
|
public var item_index(default, default):Int;
|
||||||
15
src/client/haxe/ru/m/tankz/frame/level/LevelView.yaml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
width: 440
|
||||||
|
height: 44
|
||||||
|
margins: 5
|
||||||
|
views:
|
||||||
|
- id: label
|
||||||
|
$type: haxework.gui.LabelView
|
||||||
|
$style: label
|
||||||
|
pWidth: 100
|
||||||
|
pHeight: 100
|
||||||
|
text: ""
|
||||||
|
skin:
|
||||||
|
$type: haxework.gui.skin.ColorSkin
|
||||||
|
color: "#000000"
|
||||||
|
alpha: 0.2
|
||||||
71
src/client/haxe/ru/m/tankz/render/AnimateBundle.hx
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
package ru.m.tankz.render;
|
||||||
|
|
||||||
|
import ru.m.draw.BitmapUtil;
|
||||||
|
import ru.m.draw.Color;
|
||||||
|
import flash.display.BitmapData;
|
||||||
|
import openfl.Assets;
|
||||||
|
import ru.m.animate.Animate;
|
||||||
|
import ru.m.animate.OnceAnimate;
|
||||||
|
import ru.m.tankz.core.Tank;
|
||||||
|
import ru.m.tankz.Type;
|
||||||
|
|
||||||
|
|
||||||
|
class AnimateBundle {
|
||||||
|
|
||||||
|
private static function buildAnimate(name:String, sequence:Array<Int>):OnceAnimate {
|
||||||
|
var template:String = 'resources/image/animate/${name}/%index%.png';
|
||||||
|
var frames = [for (i in sequence) ({
|
||||||
|
image: Assets.getBitmapData(StringTools.replace(template, '%index%', Std.string(i))),
|
||||||
|
length: 1
|
||||||
|
})];
|
||||||
|
return new OnceAnimate(frames);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function tankSpawn():OnceAnimate {
|
||||||
|
return buildAnimate('appear', [
|
||||||
|
0, 1, 2, 3, 3, 4, 5, 5, 6
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function tankBoom():OnceAnimate {
|
||||||
|
return buildAnimate('boom', [
|
||||||
|
0, 1, 2, 3, 4, 4, 4, 1, 4, 4, 7, 7, 8, 9, 9
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function bulletBoom():OnceAnimate {
|
||||||
|
return buildAnimate('boom-sm', [
|
||||||
|
0, 1, 1, 0, 0, 1
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function tankProtect():Animate {
|
||||||
|
return new Animate([for (i in 0...2) ({
|
||||||
|
image: Assets.getBitmapData('resources/image/animate/protect/${i}.png'),
|
||||||
|
length: 5
|
||||||
|
})]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function tankFrames(tank:Tank):Array<Frame> {
|
||||||
|
var color:Color = switch (tank.hits) {
|
||||||
|
case 1: 0x869C43;
|
||||||
|
case 2: 0xDEAF80;
|
||||||
|
case 3: 0x5EA67A;
|
||||||
|
case _: tank.color;
|
||||||
|
}
|
||||||
|
var colors:Array<Color> = [color, color];
|
||||||
|
if (tank.bonus) {
|
||||||
|
colors[1] = 0xff00aa;
|
||||||
|
}
|
||||||
|
return [for (i in 0...2) ({
|
||||||
|
image: BitmapUtil.colorize(Assets.getBitmapData('resources/image/tank/${tank.config.skin}-${i}.png'), colors[i]),
|
||||||
|
length: 3
|
||||||
|
})];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function bonusFrames(type:BonusType):Array<Frame> {
|
||||||
|
var image = Assets.getBitmapData('resources/image/bonus/${type}.png');
|
||||||
|
var empty = new BitmapData(image.width, image.height, true, 0x00000000);
|
||||||
|
return [{image: image, length: 15}, {image: empty, length: 15}];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,19 +1,15 @@
|
|||||||
package ru.m.tankz.render;
|
package ru.m.tankz.render;
|
||||||
|
|
||||||
import ru.m.geom.Point;
|
|
||||||
import openfl.Assets;
|
|
||||||
import ru.m.animate.OnceAnimate;
|
|
||||||
import flash.display.DisplayObjectContainer;
|
import flash.display.DisplayObjectContainer;
|
||||||
import ru.m.tankz.core.EntityType;
|
|
||||||
import flash.display.DisplayObject;
|
|
||||||
import Type.ValueType;
|
|
||||||
import ru.m.tankz.render.RenderItem;
|
|
||||||
import ru.m.tankz.engine.Engine;
|
|
||||||
import ru.m.tankz.core.Bullet;
|
|
||||||
import ru.m.tankz.core.Tank;
|
|
||||||
import flash.display.Sprite;
|
|
||||||
import flash.display.Graphics;
|
import flash.display.Graphics;
|
||||||
|
import flash.display.Sprite;
|
||||||
import haxework.gui.SpriteView;
|
import haxework.gui.SpriteView;
|
||||||
|
import ru.m.animate.Animate;
|
||||||
|
import ru.m.animate.OnceAnimate;
|
||||||
|
import ru.m.geom.Point;
|
||||||
|
import ru.m.tankz.core.EntityType;
|
||||||
|
import ru.m.tankz.engine.Engine;
|
||||||
|
import ru.m.tankz.render.RenderItem;
|
||||||
|
|
||||||
|
|
||||||
class Render extends SpriteView implements EngineListener {
|
class Render extends SpriteView implements EngineListener {
|
||||||
@@ -58,13 +54,21 @@ class Render extends SpriteView implements EngineListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function draw(game:Engine):Void {
|
public function draw(game:Engine):Void {
|
||||||
for (brick in game.map.bricks) if (brick.config.type > 0) {
|
for (brick in game.map.bricks) if (brick.config.index > 0) {
|
||||||
if (!items.exists(brick.key)) {
|
if (!items.exists(brick.key)) {
|
||||||
items[brick.key] = new BrickItem(brick);
|
var item:RenderItem<Dynamic, Dynamic> = switch(brick.config.type) {
|
||||||
if (brick.config.layer > 2) {
|
case 'ace' | 'bush': new BrickItem(brick);
|
||||||
upLayer.addChild(items[brick.key].view);
|
case 'water': new BrickAnimateItem(brick);
|
||||||
} else {
|
case 'armor' | 'brick': new BrickBreakingItem(brick);
|
||||||
groundLayer.addChild(items[brick.key].view);
|
case x: null;
|
||||||
|
};
|
||||||
|
if (item != null) {
|
||||||
|
items[brick.key] = item;
|
||||||
|
if (brick.config.layer > 2) {
|
||||||
|
upLayer.addChild(item.view);
|
||||||
|
} else {
|
||||||
|
groundLayer.addChild(item.view);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -101,6 +105,7 @@ class Render extends SpriteView implements EngineListener {
|
|||||||
items.set(tank.key, item);
|
items.set(tank.key, item);
|
||||||
entryLayer.addChild(item.view);
|
entryLayer.addChild(item.view);
|
||||||
item.update();
|
item.update();
|
||||||
|
playAnimate(tank.rect.center, AnimateBundle.tankSpawn());
|
||||||
case EntityType.BULLET(bullet):
|
case EntityType.BULLET(bullet):
|
||||||
var item = new BulletItem(bullet);
|
var item = new BulletItem(bullet);
|
||||||
items.set(bullet.key, item);
|
items.set(bullet.key, item);
|
||||||
@@ -111,63 +116,56 @@ class Render extends SpriteView implements EngineListener {
|
|||||||
items.set(eagle.key, item);
|
items.set(eagle.key, item);
|
||||||
entryLayer.addChild(item.view);
|
entryLayer.addChild(item.view);
|
||||||
item.update();
|
item.update();
|
||||||
|
case EntityType.BONUS(bonus):
|
||||||
|
var item = new BonusItem(bonus);
|
||||||
|
items.set(bonus.key, item);
|
||||||
|
upperLayer.addChild(item.view);
|
||||||
|
item.update();
|
||||||
case _:
|
case _:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onCollision(entity:EntityType, with:EntityType):Void {
|
public function onChange(entity:EntityType, ?change:EntityChange):Void {}
|
||||||
|
|
||||||
|
public function onCollision(entity:EntityType, with:EntityType):Void {
|
||||||
|
switch [entity, with] {
|
||||||
|
case [EntityType.BULLET(_), EntityType.EAGLE(eagle)]:
|
||||||
|
if (eagle.death) {
|
||||||
|
playAnimate(eagle.rect.center, AnimateBundle.tankBoom());
|
||||||
|
}
|
||||||
|
case _:
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onDestroy(entity:EntityType):Void {
|
public function onDestroy(entity:EntityType):Void {
|
||||||
switch(entity) {
|
switch entity {
|
||||||
case EntityType.TANK(tank):
|
case EntityType.TANK(tank):
|
||||||
if (items.exists(tank.key)) {
|
if (items.exists(tank.key)) {
|
||||||
entryLayer.removeChild(items.get(tank.key).view);
|
entryLayer.removeChild(items.get(tank.key).view);
|
||||||
items.remove(tank.key);
|
items.remove(tank.key);
|
||||||
playTankBoom(tank.rect.center);
|
playAnimate(tank.rect.center, AnimateBundle.tankBoom());
|
||||||
}
|
}
|
||||||
case EntityType.BULLET(bullet):
|
case EntityType.BULLET(bullet):
|
||||||
if (items.exists(bullet.key)) {
|
if (items.exists(bullet.key)) {
|
||||||
entryLayer.removeChild(items.get(bullet.key).view);
|
entryLayer.removeChild(items.get(bullet.key).view);
|
||||||
items.remove(bullet.key);
|
items.remove(bullet.key);
|
||||||
playBulletBoom(bullet.rect.center.add(new Point(bullet.rect.width * bullet.rect.direction.x, bullet.rect.height * bullet.rect.direction.y)));
|
var point = bullet.rect.center.add(new Point(bullet.rect.width * bullet.rect.direction.x, bullet.rect.height * bullet.rect.direction.y));
|
||||||
|
playAnimate(point, AnimateBundle.bulletBoom());
|
||||||
}
|
}
|
||||||
case EntityType.EAGLE(eagle):
|
case EntityType.BONUS(bonus):
|
||||||
if (items.exists(eagle.key)) {
|
if (items.exists(bonus.key)) {
|
||||||
cast(items.get(eagle.key), EagleItem).destoyed = true;
|
upperLayer.removeChild(items.get(bonus.key).view);
|
||||||
items.get(eagle.key).redraw();
|
items.remove(bonus.key);
|
||||||
playTankBoom(eagle.rect.center);
|
|
||||||
}
|
}
|
||||||
case _:
|
case _:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function playBulletBoom(point:Point):Void {
|
private function playAnimate(point:Point, animate:OnceAnimate):Void {
|
||||||
var arr = [
|
|
||||||
0, 1, 1, 0, 0, 1
|
|
||||||
];
|
|
||||||
var frames = [for (i in arr) Assets.getBitmapData('resources/images/bullet/boom/boom-${i}.png')];
|
|
||||||
var animate = new OnceAnimate(frames);
|
|
||||||
animate.x = point.x - animate.width / 2;
|
animate.x = point.x - animate.width / 2;
|
||||||
animate.y = point.y - animate.height / 2;
|
animate.y = point.y - animate.height / 2;
|
||||||
upperLayer.addChild(animate);
|
upperLayer.addChild(animate);
|
||||||
animate.play().then(function(animate) {
|
animate.play().then(function(animate:Animate):Void {
|
||||||
upperLayer.removeChild(animate);
|
|
||||||
animate.dispose();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private function playTankBoom(point:Point):Void {
|
|
||||||
var arr = [
|
|
||||||
0, 1, 2, 3, 4, 4, 4, 1, 4, 4, 7, 7, 8, 9, 9
|
|
||||||
];
|
|
||||||
var frames = [for (i in arr) Assets.getBitmapData('resources/images/tank/kaboom/kaboom-${i}.png')];
|
|
||||||
var animate = new OnceAnimate(frames);
|
|
||||||
animate.x = point.x - animate.width / 2;
|
|
||||||
animate.y = point.y - animate.height / 2;
|
|
||||||
upperLayer.addChild(animate);
|
|
||||||
animate.play().then(function(animate) {
|
|
||||||
upperLayer.removeChild(animate);
|
upperLayer.removeChild(animate);
|
||||||
animate.dispose();
|
animate.dispose();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,23 +1,25 @@
|
|||||||
package ru.m.tankz.render;
|
package ru.m.tankz.render;
|
||||||
|
|
||||||
import ru.m.animate.Animate;
|
import flash.display.Bitmap;
|
||||||
import ru.m.tankz.core.Eagle;
|
|
||||||
import flash.display.DisplayObject;
|
import flash.display.DisplayObject;
|
||||||
import flash.display.Shape;
|
import flash.display.Shape;
|
||||||
|
import flash.display.Sprite;
|
||||||
|
import openfl.Assets;
|
||||||
|
import ru.m.animate.Animate;
|
||||||
import ru.m.geom.Direction;
|
import ru.m.geom.Direction;
|
||||||
import ru.m.geom.Rectangle;
|
import ru.m.geom.Rectangle;
|
||||||
|
import ru.m.tankz.core.Bonus;
|
||||||
import ru.m.tankz.core.Bullet;
|
import ru.m.tankz.core.Bullet;
|
||||||
import ru.m.tankz.map.Brick;
|
import ru.m.tankz.core.Eagle;
|
||||||
import openfl.Assets;
|
|
||||||
import ru.m.tankz.core.Tank;
|
import ru.m.tankz.core.Tank;
|
||||||
import flash.display.Bitmap;
|
import ru.m.tankz.map.Brick;
|
||||||
|
import ru.m.tankz.Type.BrickType;
|
||||||
|
|
||||||
|
|
||||||
typedef TRectangle = {
|
typedef TRectangle = {
|
||||||
var rect(default, null):Rectangle;
|
var rect(default, null):Rectangle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class RenderItem<T:TRectangle, D:DisplayObject> {
|
class RenderItem<T:TRectangle, D:DisplayObject> {
|
||||||
|
|
||||||
public var value(default, null):T;
|
public var value(default, null):T;
|
||||||
@@ -73,9 +75,50 @@ class BitmapItem<T:TRectangle> extends RenderItem<T, Bitmap> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class BrickItem extends RenderItem<Brick, Shape> {
|
class BrickItem extends BitmapItem<Brick> {
|
||||||
|
private var type:BrickType;
|
||||||
|
|
||||||
|
public function new(value:Brick) {
|
||||||
|
super(value);
|
||||||
|
redraw();
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function update():Void {
|
||||||
|
super.update();
|
||||||
|
var t = value.config.type;
|
||||||
|
if (t != type) {
|
||||||
|
type = t;
|
||||||
|
view.visible = t != 'none';
|
||||||
|
redraw();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override private function getImage():String {
|
||||||
|
return 'resources/image/map/${value.config.type}.png';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class BrickAnimateItem extends AnimateItem<Brick> {
|
||||||
|
|
||||||
|
public function new(value:Brick) {
|
||||||
|
super(value);
|
||||||
|
redraw();
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function redraw():Void {
|
||||||
|
view.frames = [for (i in 0...2) ({
|
||||||
|
image: Assets.getBitmapData('resources/image/map/${value.config.type}-${i}.png'),
|
||||||
|
length: 15
|
||||||
|
})];
|
||||||
|
view.playing = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class BrickBreakingItem extends RenderItem<Brick, Shape> {
|
||||||
private var broken:Int;
|
private var broken:Int;
|
||||||
|
private var type:BrickType;
|
||||||
|
|
||||||
public function new(value:Brick) {
|
public function new(value:Brick) {
|
||||||
super(value);
|
super(value);
|
||||||
@@ -88,85 +131,109 @@ class BrickItem extends RenderItem<Brick, Shape> {
|
|||||||
var g = view.graphics;
|
var g = view.graphics;
|
||||||
g.clear();
|
g.clear();
|
||||||
if (value.destroyed) return;
|
if (value.destroyed) return;
|
||||||
g.beginBitmapFill(image);
|
if (value.config.index > 0) {
|
||||||
g.drawRect(0, 0, value.rect.width, value.rect.height);
|
g.beginBitmapFill(image);
|
||||||
for (c in value.cells) {
|
g.drawRect(0, 0, value.rect.width, value.rect.height);
|
||||||
if (c.destroyed) {
|
for (c in value.cells) {
|
||||||
g.beginFill(0x000000);
|
if (c.destroyed) {
|
||||||
g.drawRect(c.rect.x - value.rect.x, c.rect.y - value.rect.y, c.rect.width, c.rect.height);
|
g.beginFill(0x000000);
|
||||||
|
g.drawRect(c.rect.x - value.rect.x, c.rect.y - value.rect.y, c.rect.width, c.rect.height);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
g.endFill();
|
||||||
}
|
}
|
||||||
g.endFill();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override public function update():Void {
|
override public function update():Void {
|
||||||
super.update();
|
super.update();
|
||||||
var b = value.broken;
|
var b = value.broken;
|
||||||
if (b != this.broken) {
|
var t = value.config.type;
|
||||||
this.broken = b;
|
if (b != broken || t != type) {
|
||||||
|
broken = b;
|
||||||
|
type = t;
|
||||||
redraw();
|
redraw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getImage():String {
|
private function getImage():String {
|
||||||
return 'resources/images/map/map_${value.config.type}.png';
|
return 'resources/image/map/${value.config.type}.png';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class TankItem extends RenderItem<Tank, Animate> {
|
class AnimateItem<T:TRectangle> extends RenderItem<T, Animate> {
|
||||||
|
|
||||||
|
public function new(value:T) {
|
||||||
|
super(value);
|
||||||
|
view = new Animate();
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function dispose():Void {
|
||||||
|
view.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class TankItem extends RenderItem<Tank, Sprite> {
|
||||||
|
|
||||||
private var type:String;
|
private var type:String;
|
||||||
private var hits:Int;
|
private var hits:Int;
|
||||||
|
private var protected:Bool;
|
||||||
|
private var frozen:Bool;
|
||||||
|
|
||||||
|
private var tankView:Animate;
|
||||||
|
private var protectView:Animate;
|
||||||
|
|
||||||
public function new(value:Tank) {
|
public function new(value:Tank) {
|
||||||
super(value);
|
super(value);
|
||||||
view = new Animate();
|
view = new Sprite();
|
||||||
|
tankView = new Animate();
|
||||||
|
view.addChild(tankView);
|
||||||
|
protectView = AnimateBundle.tankProtect();
|
||||||
|
protectView.visible = false;
|
||||||
|
view.addChild(protectView);
|
||||||
redraw();
|
redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
override public function redraw():Void {
|
override public function redraw():Void {
|
||||||
view.frames = getFrames().map(function(s) return Assets.getBitmapData(s));
|
tankView.frames = AnimateBundle.tankFrames(value);
|
||||||
|
if (value.protect.active) {
|
||||||
|
protectView.x = (tankView.frames[0].image.width - protectView.frames[0].image.width) / 2;
|
||||||
|
protectView.y = (tankView.frames[0].image.height - protectView.frames[0].image.height) / 2;
|
||||||
|
protectView.playing = true;
|
||||||
|
protectView.visible = true;
|
||||||
|
} else {
|
||||||
|
protectView.playing = false;
|
||||||
|
protectView.visible = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getFrames():Array<String> {
|
private function getFrames():Array<String> {
|
||||||
var team = value.playerId.team;
|
var frame0 = 'resources/image/tank/${value.config.skin}-0.png';
|
||||||
var group = value.config.group;
|
var frame1 = 'resources/image/tank/${value.config.skin}-1.png';
|
||||||
var index = value.playerId.index;
|
return [frame1, frame0];
|
||||||
if (team == 'radiant') {
|
|
||||||
index = 0;
|
|
||||||
}
|
|
||||||
if (team == 'dire') {
|
|
||||||
index = 1;
|
|
||||||
}
|
|
||||||
if (team == 'human' || team == 'radiant' || team == 'dire') {
|
|
||||||
group = 'player';
|
|
||||||
}
|
|
||||||
if (team == 'bot') {
|
|
||||||
index = value.hits;
|
|
||||||
}
|
|
||||||
return [
|
|
||||||
'resources/images/tank/${group}/tank_${group.charAt(0)}${value.config.type}_${index}-0.png',
|
|
||||||
'resources/images/tank/${group}/tank_${group.charAt(0)}${value.config.type}_${index}-1.png',
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override public function update():Void {
|
override public function update():Void {
|
||||||
super.update();
|
super.update();
|
||||||
var t = value.config.type;
|
var t = value.config.type;
|
||||||
var h = value.hits;
|
var h = value.hits;
|
||||||
if (t != this.type || h != this.hits) {
|
var p = value.protect.active;
|
||||||
|
var f = value.freezing.active;
|
||||||
|
if (t != type || h != hits || p != protected || f != frozen) {
|
||||||
this.type = t;
|
this.type = t;
|
||||||
this.hits = h;
|
this.hits = h;
|
||||||
|
this.protected = p;
|
||||||
|
this.frozen = f;
|
||||||
redraw();
|
redraw();
|
||||||
}
|
}
|
||||||
view.playing = (value.mx !=0 || value.my != 0);
|
tankView.playing = !value.freezing.active && (value.mx !=0 || value.my != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
override public function dispose():Void {
|
override public function dispose():Void {
|
||||||
if (view != null) {
|
if (tankView != null) {
|
||||||
view.dispose();
|
tankView.dispose();
|
||||||
view = null;
|
tankView = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -175,16 +242,46 @@ class TankItem extends RenderItem<Tank, Animate> {
|
|||||||
class BulletItem extends BitmapItem<Bullet> {
|
class BulletItem extends BitmapItem<Bullet> {
|
||||||
|
|
||||||
override private function getImage():String {
|
override private function getImage():String {
|
||||||
return 'resources/images/bullet/bullet_${value.config.piercing > 1 ? 1 : 0}.png';
|
var type:String = 'normal';
|
||||||
|
if (value.config.piercing > 0) type = 'piercing';
|
||||||
|
return 'resources/image/bullet/${type}.png';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class EagleItem extends BitmapItem<Eagle> {
|
class EagleItem extends BitmapItem<Eagle> {
|
||||||
|
|
||||||
public var destoyed(default, default):Bool;
|
private var death:Bool;
|
||||||
|
private var protected:Bool;
|
||||||
|
|
||||||
|
override public function update():Void {
|
||||||
|
super.update();
|
||||||
|
var d = value.death;
|
||||||
|
var p = value.protect.active;
|
||||||
|
if (d != death || p != protected) {
|
||||||
|
death = d;
|
||||||
|
protected = p;
|
||||||
|
redraw();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override private function getImage():String {
|
override private function getImage():String {
|
||||||
return 'resources/images/eagle/eagle-${destoyed ? 1 : 0}.png';
|
var suffix = value.death ? '-death' : value.protect.active ? '-protected' : '';
|
||||||
|
return 'resources/image/eagle/eagle${suffix}.png';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class BonusItem extends AnimateItem<Bonus> {
|
||||||
|
|
||||||
|
public function new(value:Bonus) {
|
||||||
|
super(value);
|
||||||
|
redraw();
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function redraw():Void {
|
||||||
|
var image = Assets.getBitmapData('resources/image/bonus/${value.config.type}.png');
|
||||||
|
view.frames = AnimateBundle.bonusFrames(value.config.type);
|
||||||
|
view.playing = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
33
src/client/haxe/ru/m/tankz/storage/SaveStorage.hx
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
package ru.m.tankz.storage;
|
||||||
|
|
||||||
|
import flash.net.SharedObject;
|
||||||
|
import ru.m.tankz.Type;
|
||||||
|
import ru.m.tankz.game.GameSave;
|
||||||
|
|
||||||
|
|
||||||
|
class SaveStorage {
|
||||||
|
|
||||||
|
private static var TAG(default, never):String = 'SaveStorage';
|
||||||
|
|
||||||
|
private var so:SharedObject;
|
||||||
|
|
||||||
|
public function new() {
|
||||||
|
so = SharedObject.getLocal('tankz');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function read(type:GameType):Null<GameSave> {
|
||||||
|
var data:String = Reflect.getProperty(so.data, type);
|
||||||
|
L.d(TAG, 'read: ${data}');
|
||||||
|
if (data != null) {
|
||||||
|
return GameSave.fromYaml(data);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function write(save:GameSave):Void {
|
||||||
|
var data:String = save.toYaml();
|
||||||
|
L.d(TAG, 'write: ${data}');
|
||||||
|
so.setProperty(save.state.type, data);
|
||||||
|
so.flush();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
package ru.m.tankz.view.frames;
|
|
||||||
|
|
||||||
import ru.m.tankz.game.Game;
|
|
||||||
import ru.m.tankz.game.GameState;
|
|
||||||
import ru.m.tankz.game.ClassicGame;
|
|
||||||
import ru.m.tankz.game.DotaGame;
|
|
||||||
import haxework.gui.frame.IFrameSwitcher;
|
|
||||||
import haxework.provider.Provider;
|
|
||||||
import haxework.gui.ButtonView;
|
|
||||||
import haxework.gui.ViewBuilder;
|
|
||||||
import haxework.gui.VGroupView;
|
|
||||||
|
|
||||||
|
|
||||||
interface StartFrameLayout {
|
|
||||||
var start_1p(default, null):ButtonView;
|
|
||||||
var start_2p(default, null):ButtonView;
|
|
||||||
var dota(default, null):ButtonView;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@:template("layout/frames/start.json", "layout/styles.json")
|
|
||||||
class StartFrame extends VGroupView implements ViewBuilder implements StartFrameLayout {
|
|
||||||
|
|
||||||
public static inline var ID = "start";
|
|
||||||
|
|
||||||
public function init() {
|
|
||||||
start_1p.onPress = this;
|
|
||||||
start_2p.onPress = this;
|
|
||||||
dota.onPress = this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function onPress(view:ButtonView):Void {
|
|
||||||
switch (view.id) {
|
|
||||||
case 'start_1p':
|
|
||||||
startGame(ClassicGame.TYPE, 1);
|
|
||||||
case 'start_2p':
|
|
||||||
startGame(ClassicGame.TYPE, 2);
|
|
||||||
case 'dota':
|
|
||||||
startGame(DotaGame.TYPE, 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private function startGame(type:GameType, humans:Int):Void {
|
|
||||||
switch (type) {
|
|
||||||
case ClassicGame.TYPE:
|
|
||||||
Provider.set(GameState, ClassicGame.buildState(0, humans));
|
|
||||||
Provider.get(IFrameSwitcher).change(LevelFrame.ID);
|
|
||||||
case DotaGame.TYPE:
|
|
||||||
Provider.set(GameState, DotaGame.buildState(0, humans));
|
|
||||||
Provider.get(IFrameSwitcher).change(GameFrame.ID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -9,89 +9,71 @@ map:
|
|||||||
gridHeight: 26
|
gridHeight: 26
|
||||||
|
|
||||||
bricks:
|
bricks:
|
||||||
# border
|
- {type: border, index: -1, layer: 2, armor: -1}
|
||||||
- type: -1
|
- {type: none, index: 0, layer: 0, armor: 0}
|
||||||
layer: 2
|
- {type: ace, index: 1, layer: 0, armor: 0}
|
||||||
armor: -1
|
- {type: bush, index: 2, layer: 3, armor: 0}
|
||||||
# none
|
- {type: water, index: 3, layer: 1, armor: 0}
|
||||||
- type: 0
|
- {type: armor, index: 4, layer: 2, armor: 2}
|
||||||
layer: 0
|
- {type: brick, index: 5, layer: 2, armor: 1}
|
||||||
armor: 0
|
|
||||||
# ace
|
|
||||||
- type: 1
|
|
||||||
layer: 0
|
|
||||||
armor: 0
|
|
||||||
# bush
|
|
||||||
- type: 2
|
|
||||||
layer: 3
|
|
||||||
armor: 0
|
|
||||||
# water
|
|
||||||
- type: 3
|
|
||||||
layer: 1
|
|
||||||
armor: 0
|
|
||||||
# armor
|
|
||||||
- type: 4
|
|
||||||
layer: 2
|
|
||||||
armor: 2
|
|
||||||
# brick
|
|
||||||
- type: 5
|
|
||||||
layer: 2
|
|
||||||
armor: 1
|
|
||||||
|
|
||||||
teams:
|
player:
|
||||||
- id: human
|
human: &human
|
||||||
spawnInterval: 0
|
control: human
|
||||||
|
life: 3
|
||||||
tanks:
|
tanks:
|
||||||
- group: human
|
- {type: human0, rate: 1, protect: 5}
|
||||||
type: 0
|
bot: &bot
|
||||||
rate: 1
|
control: bot
|
||||||
points:
|
color: 0xFFFFFF
|
||||||
- type: eagle
|
life: -1
|
||||||
index: -1
|
|
||||||
x: 12
|
|
||||||
y: 24
|
|
||||||
direction: right
|
|
||||||
- type: tank
|
|
||||||
index: 0
|
|
||||||
x: 8
|
|
||||||
y: 24
|
|
||||||
direction: top
|
|
||||||
- type: tank
|
|
||||||
index: 1
|
|
||||||
x: 16
|
|
||||||
y: 24
|
|
||||||
direction: top
|
|
||||||
- id: bot
|
|
||||||
spawnInterval: 3000
|
|
||||||
tanks:
|
tanks:
|
||||||
- group: bot
|
- {type: bot0, rate: 0.25, bonus: 0.25}
|
||||||
type: 0
|
- {type: bot1, rate: 0.25, bonus: 0.25}
|
||||||
rate: 0.5
|
- {type: bot2, rate: 0.25, bonus: 0.25}
|
||||||
- group: bot
|
- {type: bot3, rate: 0.25, bonus: 0.25}
|
||||||
type: 1
|
|
||||||
rate: 0.5
|
presets:
|
||||||
- group: bot
|
- id: player1
|
||||||
type: 2
|
teams:
|
||||||
rate: 0.5
|
- id: human
|
||||||
- group: bot
|
life: -1
|
||||||
type: 3
|
players:
|
||||||
rate: 0.5
|
- {<<: *human, index: 0, color: 0xF5C040, life: 3}
|
||||||
points:
|
- id: bot
|
||||||
- type: tank
|
spawnInterval: 3000
|
||||||
index: -1
|
life: 20
|
||||||
x: 0
|
players:
|
||||||
y: 0
|
- {<<: *bot, index: 0}
|
||||||
direction: bottom
|
- {<<: *bot, index: 1}
|
||||||
- type: tank
|
- {<<: *bot, index: 2}
|
||||||
index: -1
|
- {<<: *bot, index: 3}
|
||||||
x: 12
|
|
||||||
y: 0
|
- id: player2
|
||||||
direction: bottom
|
teams:
|
||||||
- type: tank
|
- id: human
|
||||||
index: -1
|
life: -1
|
||||||
x: 24
|
players:
|
||||||
y: 0
|
- {<<: *human, index: 0, color: 0xF5C040, life: 3}
|
||||||
direction: bottom
|
- {<<: *human, index: 1, color: 0x15C040, life: 3}
|
||||||
|
- id: bot
|
||||||
|
spawnInterval: 3000
|
||||||
|
life: 20
|
||||||
|
players:
|
||||||
|
- {<<: *bot, index: 0}
|
||||||
|
- {<<: *bot, index: 1}
|
||||||
|
- {<<: *bot, index: 2}
|
||||||
|
- {<<: *bot, index: 3}
|
||||||
|
- {<<: *bot, index: 4}
|
||||||
|
- {<<: *bot, index: 5}
|
||||||
|
|
||||||
|
points:
|
||||||
|
- {team: human, type: eagle, index: -1, direction: right, x: 12, y: 24}
|
||||||
|
- {team: human, type: tank, index: 0, direction: top, x: 8, y: 24}
|
||||||
|
- {team: human, type: tank, index: 1, direction: top, x: 16, y: 24}
|
||||||
|
- {team: bot, type: tank, index: -1, direction: bottom, x: 0, y: 0}
|
||||||
|
- {team: bot, type: tank, index: -2, direction: bottom, x: 12, y: 0}
|
||||||
|
- {team: bot, type: tank, index: -3, direction: bottom, x: 24, y: 0}
|
||||||
|
|
||||||
bullet: &bullet
|
bullet: &bullet
|
||||||
width: 12
|
width: 12
|
||||||
@@ -100,82 +82,101 @@ bullet: &bullet
|
|||||||
piercing: 1
|
piercing: 1
|
||||||
|
|
||||||
tanks:
|
tanks:
|
||||||
human:
|
- type: human0
|
||||||
- type: 0
|
upgrade: human1
|
||||||
width: 36
|
width: 36
|
||||||
height: 36
|
height: 36
|
||||||
speed: 2.5
|
speed: 2.5
|
||||||
bullet:
|
bullet:
|
||||||
<<: *bullet
|
<<: *bullet
|
||||||
speed: 8.0
|
speed: 8.0
|
||||||
bullets: 1
|
bullets: 1
|
||||||
|
skin: pa
|
||||||
|
|
||||||
- type: 1
|
- type: human1
|
||||||
width: 40
|
upgrade: human2
|
||||||
height: 36
|
width: 40
|
||||||
speed: 3.0
|
height: 36
|
||||||
bullet:
|
speed: 3.0
|
||||||
<<: *bullet
|
bullet:
|
||||||
speed: 8.5
|
<<: *bullet
|
||||||
bullets: 1
|
speed: 8.5
|
||||||
|
bullets: 1
|
||||||
|
skin: pb
|
||||||
|
|
||||||
- type: 2
|
- type: human2
|
||||||
width: 40
|
upgrade: human3
|
||||||
height: 36
|
width: 40
|
||||||
speed: 3.0
|
height: 36
|
||||||
bullet:
|
speed: 3.0
|
||||||
<<: *bullet
|
bullet:
|
||||||
speed: 9.0
|
<<: *bullet
|
||||||
bullets: 2
|
speed: 9.0
|
||||||
|
bullets: 2
|
||||||
|
skin: pc
|
||||||
|
|
||||||
- type: 3
|
- type: human3
|
||||||
width: 42
|
upgrade: human3
|
||||||
height: 38
|
width: 42
|
||||||
speed: 2.9
|
height: 38
|
||||||
bullet:
|
speed: 2.9
|
||||||
<<: *bullet
|
bullet:
|
||||||
speed: 9.0
|
<<: *bullet
|
||||||
piercing: 3
|
speed: 9.0
|
||||||
bullets: 2
|
piercing: 3
|
||||||
|
bullets: 2
|
||||||
|
hits: 1
|
||||||
|
skin: pd
|
||||||
|
|
||||||
bot:
|
- type: bot0
|
||||||
- type: 0
|
width: 38
|
||||||
width: 38
|
height: 36
|
||||||
height: 36
|
speed: 2.0
|
||||||
speed: 2.0
|
bullet:
|
||||||
bullet:
|
<<: *bullet
|
||||||
<<: *bullet
|
speed: 7.0
|
||||||
speed: 7.0
|
bullets: 1
|
||||||
bullets: 1
|
score: 100
|
||||||
score: 100
|
skin: ba
|
||||||
|
|
||||||
- type: 1
|
- type: bot1
|
||||||
width: 40
|
width: 40
|
||||||
height: 36
|
height: 36
|
||||||
speed: 4.0
|
speed: 4.0
|
||||||
bullet:
|
bullet:
|
||||||
<<: *bullet
|
<<: *bullet
|
||||||
speed: 7.0
|
speed: 7.0
|
||||||
bullets: 1
|
bullets: 1
|
||||||
score: 200
|
score: 200
|
||||||
|
skin: bb
|
||||||
|
|
||||||
- type: 2
|
- type: bot2
|
||||||
width: 38
|
width: 38
|
||||||
height: 36
|
height: 36
|
||||||
speed: 2.0
|
speed: 2.0
|
||||||
bullet:
|
bullet:
|
||||||
<<: *bullet
|
<<: *bullet
|
||||||
speed: 9.0
|
speed: 9.0
|
||||||
bullets: 1
|
bullets: 1
|
||||||
score: 300
|
score: 300
|
||||||
|
skin: bc
|
||||||
|
|
||||||
- type: 3
|
- type: bot3
|
||||||
width: 40
|
width: 40
|
||||||
height: 36
|
height: 36
|
||||||
speed: 1.8
|
speed: 1.8
|
||||||
bullet:
|
bullet:
|
||||||
<<: *bullet
|
<<: *bullet
|
||||||
speed: 8.0
|
speed: 8.0
|
||||||
bullets: 1
|
bullets: 1
|
||||||
score: 400
|
score: 400
|
||||||
hits: 3
|
hits: 3
|
||||||
|
skin: bd
|
||||||
|
|
||||||
|
bonuses:
|
||||||
|
- {type: clock, duration: 10}
|
||||||
|
- {type: grenade}
|
||||||
|
- {type: helmet, duration: 20}
|
||||||
|
- {type: life}
|
||||||
|
- {type: shovel, duration: 10}
|
||||||
|
- {type: star}
|
||||||
|
|||||||
@@ -1,95 +0,0 @@
|
|||||||
[keyboard]
|
|
||||||
reset = 27 ;Escape
|
|
||||||
pause = 80 ;P
|
|
||||||
|
|
||||||
[player0]
|
|
||||||
key_left = 37 ;Left
|
|
||||||
key_up = 38 ;Up
|
|
||||||
key_right = 39 ;Rigth
|
|
||||||
key_down = 40 ;Down
|
|
||||||
key_shot = 96 ;Num0
|
|
||||||
|
|
||||||
[player1]
|
|
||||||
key_left = 65 ;A
|
|
||||||
key_up = 87 ;W
|
|
||||||
key_right = 68 ;D
|
|
||||||
key_down = 83 ;S
|
|
||||||
key_shot = 32 ;Space
|
|
||||||
|
|
||||||
[bonus]
|
|
||||||
score = 500
|
|
||||||
freeztime = 10
|
|
||||||
eagletime = 20
|
|
||||||
protecttime = 15
|
|
||||||
|
|
||||||
[bots]
|
|
||||||
count = 20 ;количество ботов на уровне
|
|
||||||
respawntime = 2.5 ;задержка между появлением ботов в секундах
|
|
||||||
shotdelay = 1.0 ;задержка между выстрелами
|
|
||||||
turndelay = 0.3 ;задержка перед поворотом при столкновении
|
|
||||||
rndturndelay = 2.0 ;задержка перед случайным поворотом
|
|
||||||
turntoeagle = 0.75 ;вероятность поворота к Орлу
|
|
||||||
bonus = 0.25 ;вероятность появления бонусного танка
|
|
||||||
|
|
||||||
|
|
||||||
[tank_p0]
|
|
||||||
movespeed = 2.5 ;скорость передвижения
|
|
||||||
bulletspeed = 8.0 ;скорость полёта снаряда
|
|
||||||
bullettype = 0 ;тип снаряда (0 - обычный, 1 - бронебойный)
|
|
||||||
bulletcount = 1 ;количество снарядов
|
|
||||||
hits = 1 ;количество хитпойнтов
|
|
||||||
|
|
||||||
[tank_p1]
|
|
||||||
movespeed = 3.0
|
|
||||||
bulletspeed = 8.5
|
|
||||||
bullettype = 0
|
|
||||||
bulletcount = 1
|
|
||||||
hits = 1
|
|
||||||
|
|
||||||
[tank_p2]
|
|
||||||
movespeed = 3.0
|
|
||||||
bulletspeed = 9.0
|
|
||||||
bullettype = 0
|
|
||||||
bulletcount = 2
|
|
||||||
hits = 1
|
|
||||||
|
|
||||||
[tank_p3]
|
|
||||||
movespeed = 2.9
|
|
||||||
bulletspeed = 9.0
|
|
||||||
bullettype = 1
|
|
||||||
bulletcount = 2
|
|
||||||
hits = 2
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[tank_b0]
|
|
||||||
movespeed = 2.0
|
|
||||||
bulletspeed = 7.0
|
|
||||||
bullettype = 0
|
|
||||||
bulletcount = 1
|
|
||||||
hits = 1
|
|
||||||
score = 100
|
|
||||||
|
|
||||||
[tank_b1]
|
|
||||||
movespeed = 4.0
|
|
||||||
bulletspeed = 7.0
|
|
||||||
bullettype = 0
|
|
||||||
bulletcount = 1
|
|
||||||
hits = 1
|
|
||||||
score = 200
|
|
||||||
|
|
||||||
[tank_b2]
|
|
||||||
movespeed = 2.0
|
|
||||||
bulletspeed = 9.0
|
|
||||||
bullettype = 0
|
|
||||||
bulletcount = 1
|
|
||||||
hits = 1
|
|
||||||
score = 300
|
|
||||||
|
|
||||||
[tank_b3]
|
|
||||||
movespeed = 1.8
|
|
||||||
bulletspeed = 8.0
|
|
||||||
bullettype = 0
|
|
||||||
bulletcount = 1
|
|
||||||
hits = 4
|
|
||||||
score = 400
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
game:
|
game:
|
||||||
levels: 2
|
levels: 8
|
||||||
friendlyFire: true
|
friendlyFire: true
|
||||||
|
|
||||||
map:
|
map:
|
||||||
@@ -9,120 +9,104 @@ map:
|
|||||||
gridHeight: 30
|
gridHeight: 30
|
||||||
|
|
||||||
bricks:
|
bricks:
|
||||||
# border
|
- {type: border, index: -1, layer: 2, armor: -1}
|
||||||
- type: -1
|
- {type: none, index: 0, layer: 0, armor: 0}
|
||||||
layer: 2
|
- {type: ace, index: 1, layer: 0, armor: 0}
|
||||||
armor: -1
|
- {type: bush, index: 2, layer: 3, armor: 0}
|
||||||
# none
|
- {type: water, index: 3, layer: 1, armor: 0}
|
||||||
- type: 0
|
- {type: armor, index: 4, layer: 2, armor: 2}
|
||||||
layer: 0
|
- {type: brick, index: 5, layer: 2, armor: 1}
|
||||||
armor: 0
|
|
||||||
# ace
|
|
||||||
- type: 1
|
|
||||||
layer: 0
|
|
||||||
armor: 0
|
|
||||||
# bush
|
|
||||||
- type: 2
|
|
||||||
layer: 3
|
|
||||||
armor: 0
|
|
||||||
# water
|
|
||||||
- type: 3
|
|
||||||
layer: 1
|
|
||||||
armor: 0
|
|
||||||
# armor
|
|
||||||
- type: 4
|
|
||||||
layer: 2
|
|
||||||
armor: 2
|
|
||||||
# brick
|
|
||||||
- type: 5
|
|
||||||
layer: 2
|
|
||||||
armor: 1
|
|
||||||
|
|
||||||
team_tanks: &team_tanks
|
team:
|
||||||
tanks:
|
radiant: &radiant
|
||||||
- group: any
|
|
||||||
type: 0
|
|
||||||
rate: 0.25
|
|
||||||
- group: any
|
|
||||||
type: 1
|
|
||||||
rate: 0.25
|
|
||||||
- group: any
|
|
||||||
type: 2
|
|
||||||
rate: 0.25
|
|
||||||
# - group: any
|
|
||||||
# type: 3
|
|
||||||
# rate: 0.25
|
|
||||||
|
|
||||||
teams:
|
|
||||||
- <<: *team_tanks
|
|
||||||
id: radiant
|
id: radiant
|
||||||
spawnInterval: 0
|
color: 0xff4422
|
||||||
points:
|
life: 20
|
||||||
- type: eagle
|
dire: &dire
|
||||||
index: -1
|
|
||||||
x: 0
|
|
||||||
y: 28
|
|
||||||
direction: right
|
|
||||||
- type: tank
|
|
||||||
index: 0
|
|
||||||
x: 0
|
|
||||||
y: 0
|
|
||||||
direction: right
|
|
||||||
- type: tank
|
|
||||||
index: 1
|
|
||||||
x: 6
|
|
||||||
y: 10
|
|
||||||
direction: right
|
|
||||||
- type: tank
|
|
||||||
index: 2
|
|
||||||
x: 6
|
|
||||||
y: 16
|
|
||||||
direction: right
|
|
||||||
- type: tank
|
|
||||||
index: 3
|
|
||||||
x: 6
|
|
||||||
y: 22
|
|
||||||
direction: right
|
|
||||||
- type: tank
|
|
||||||
index: 4
|
|
||||||
x: 10
|
|
||||||
y: 28
|
|
||||||
direction: right
|
|
||||||
- <<: *team_tanks
|
|
||||||
id: dire
|
id: dire
|
||||||
spawnInterval: 0
|
color: 0x2244ff
|
||||||
points:
|
life: 20
|
||||||
- type: eagle
|
|
||||||
index: -1
|
|
||||||
x: 38
|
|
||||||
y: 0
|
|
||||||
direction: right
|
|
||||||
- type: tank
|
|
||||||
index: 0
|
|
||||||
x: 38
|
|
||||||
y: 28
|
|
||||||
direction: left
|
|
||||||
- type: tank
|
|
||||||
index: 1
|
|
||||||
x: 32
|
|
||||||
y: 18
|
|
||||||
direction: left
|
|
||||||
- type: tank
|
|
||||||
index: 2
|
|
||||||
x: 32
|
|
||||||
y: 12
|
|
||||||
direction: left
|
|
||||||
- type: tank
|
|
||||||
index: 3
|
|
||||||
x: 32
|
|
||||||
y: 6
|
|
||||||
direction: left
|
|
||||||
- type: tank
|
|
||||||
index: 4
|
|
||||||
x: 28
|
|
||||||
y: 0
|
|
||||||
direction: left
|
|
||||||
|
|
||||||
|
player: &player
|
||||||
|
life: -1
|
||||||
|
control: bot
|
||||||
|
tanks:
|
||||||
|
- {type: slow, rate: 0.5, protect: 3, bonus: 0}
|
||||||
|
- {type: fast, rate: 0.5, protect: 3, bonus: 0}
|
||||||
|
|
||||||
|
human1: &human1
|
||||||
|
<<: *player
|
||||||
|
control: human
|
||||||
|
color: 0xf055a0
|
||||||
|
|
||||||
|
human2: &human2
|
||||||
|
<<: *player
|
||||||
|
control: human
|
||||||
|
color: 0xa055f0
|
||||||
|
|
||||||
|
presets:
|
||||||
|
- id: player1
|
||||||
|
teams:
|
||||||
|
- <<: *radiant
|
||||||
|
players:
|
||||||
|
- {<<: *human1, index: 0}
|
||||||
|
- {<<: *player, index: 1}
|
||||||
|
- {<<: *player, index: 2}
|
||||||
|
- {<<: *player, index: 3}
|
||||||
|
- {<<: *player, index: 4}
|
||||||
|
- <<: *dire
|
||||||
|
players:
|
||||||
|
- {<<: *player, index: 0}
|
||||||
|
- {<<: *player, index: 1}
|
||||||
|
- {<<: *player, index: 2}
|
||||||
|
- {<<: *player, index: 3}
|
||||||
|
- {<<: *player, index: 4}
|
||||||
|
- id: player2_coop
|
||||||
|
teams:
|
||||||
|
- <<: *radiant
|
||||||
|
players:
|
||||||
|
- {<<: *human1, index: 0}
|
||||||
|
- {<<: *human1, index: 1}
|
||||||
|
- {<<: *player, index: 2}
|
||||||
|
- {<<: *player, index: 3}
|
||||||
|
- {<<: *player, index: 4}
|
||||||
|
- <<: *dire
|
||||||
|
players:
|
||||||
|
- {<<: *player, index: 0}
|
||||||
|
- {<<: *player, index: 1}
|
||||||
|
- {<<: *player, index: 2}
|
||||||
|
- {<<: *player, index: 3}
|
||||||
|
- {<<: *player, index: 4}
|
||||||
|
- id: player2_vs
|
||||||
|
teams:
|
||||||
|
- <<: *radiant
|
||||||
|
players:
|
||||||
|
- {<<: *human1, index: 0}
|
||||||
|
- {<<: *player, index: 1}
|
||||||
|
- {<<: *player, index: 2}
|
||||||
|
- {<<: *player, index: 3}
|
||||||
|
- {<<: *player, index: 4}
|
||||||
|
- <<: *dire
|
||||||
|
players:
|
||||||
|
- {<<: *human2, index: 0}
|
||||||
|
- {<<: *player, index: 1}
|
||||||
|
- {<<: *player, index: 2}
|
||||||
|
- {<<: *player, index: 3}
|
||||||
|
- {<<: *player, index: 4}
|
||||||
|
|
||||||
|
points:
|
||||||
|
- {team: radiant, type: eagle, index: -1, direction: right, x: 0, y: 28}
|
||||||
|
- {team: radiant, type: tank, index: 0, direction: right, x: 0, y: 0}
|
||||||
|
- {team: radiant, type: tank, index: 1, direction: right, x: 6, y: 10}
|
||||||
|
- {team: radiant, type: tank, index: 2, direction: right, x: 6, y: 16}
|
||||||
|
- {team: radiant, type: tank, index: 3, direction: right, x: 6, y: 22}
|
||||||
|
- {team: radiant, type: tank, index: 4, direction: right, x: 10, y: 28}
|
||||||
|
- {team: dire, type: eagle, index: -1, direction: right, x: 38, y: 0}
|
||||||
|
- {team: dire, type: tank, index: 0, direction: left, x: 38, y: 28}
|
||||||
|
- {team: dire, type: tank, index: 1, direction: left, x: 32, y: 18}
|
||||||
|
- {team: dire, type: tank, index: 2, direction: left, x: 32, y: 12}
|
||||||
|
- {team: dire, type: tank, index: 3, direction: left, x: 32, y: 6}
|
||||||
|
- {team: dire, type: tank, index: 4, direction: left, x: 28, y: 0}
|
||||||
|
|
||||||
bullet: &bullet
|
bullet: &bullet
|
||||||
width: 12
|
width: 12
|
||||||
@@ -131,40 +115,30 @@ bullet: &bullet
|
|||||||
piercing: 1
|
piercing: 1
|
||||||
|
|
||||||
tanks:
|
tanks:
|
||||||
any:
|
- type: slow
|
||||||
- type: 0
|
width: 38
|
||||||
width: 36
|
height: 36
|
||||||
height: 36
|
speed: 2.3
|
||||||
speed: 2.5
|
bullet:
|
||||||
bullet:
|
<<: *bullet
|
||||||
<<: *bullet
|
speed: 12.0
|
||||||
speed: 8.0
|
bullets: 1
|
||||||
bullets: 1
|
skin: bc
|
||||||
|
|
||||||
- type: 1
|
- type: fast
|
||||||
width: 40
|
width: 40
|
||||||
height: 36
|
height: 36
|
||||||
speed: 3.0
|
speed: 4.0
|
||||||
bullet:
|
bullet:
|
||||||
<<: *bullet
|
<<: *bullet
|
||||||
speed: 8.5
|
speed: 8.0
|
||||||
bullets: 1
|
bullets: 1
|
||||||
|
skin: bb
|
||||||
|
|
||||||
- type: 2
|
bonuses:
|
||||||
width: 40
|
- {type: clock, duration: 10}
|
||||||
height: 36
|
- {type: grenade}
|
||||||
speed: 3.0
|
- {type: helmet, duration: 20}
|
||||||
bullet:
|
- {type: life}
|
||||||
<<: *bullet
|
- {type: shovel, duration: 10}
|
||||||
speed: 9.0
|
- {type: star}
|
||||||
bullets: 2
|
|
||||||
|
|
||||||
- type: 3
|
|
||||||
width: 42
|
|
||||||
height: 38
|
|
||||||
speed: 2.9
|
|
||||||
bullet:
|
|
||||||
<<: *bullet
|
|
||||||
speed: 9.0
|
|
||||||
piercing: 3
|
|
||||||
bullets: 2
|
|
||||||
|
|||||||
@@ -1,30 +1,2 @@
|
|||||||
0000000000000000000000000000000000005500
|
points: [{index: -1, team: radiant, x: 0, direction: right, type: eagle, y: 28}, {index: 0, team: radiant, x: 0, direction: right, type: tank, y: 0}, {index: 1, team: radiant, x: 6, direction: right, type: tank, y: 10}, {index: 2, team: radiant, x: 6, direction: right, type: tank, y: 16}, {index: 3, team: radiant, x: 6, direction: right, type: tank, y: 22}, {index: 4, team: radiant, x: 10, direction: right, type: tank, y: 28}, {index: -1, team: dire, x: 38, direction: right, type: eagle, y: 0}, {index: 0, team: dire, x: 38, direction: left, type: tank, y: 28}, {index: 1, team: dire, x: 32, direction: left, type: tank, y: 18}, {index: 2, team: dire, x: 32, direction: left, type: tank, y: 12}, {index: 3, team: dire, x: 32, direction: left, type: tank, y: 6}, {index: 4, team: dire, x: 28, direction: left, type: tank, y: 0}]
|
||||||
0000000000000000000000000000000000005500
|
data: "000044000000000000000000005500004400550000004400000000000000000000550000440055000000440000004400003333000055000044005555000044000000440000333300005500004400555500004422442244000000000000550000440000000000442244224400000000000055000044000000000000000000444444555544444400442200330000000000000044444455554444440044220033005555333333554422220000222244000022003300555533333355442222000022224400002200330000000000000044220000000022440000440033000000000000004422000000002244000044003300000000000000550000555500005500002200000000000000000055000055550000550000220000004444444400005500445555440055000044444444444444440000550044555544005500004444444400000022000055000055550000550000000000000000002200005500005555000055000000000000003300440000442200000000224400000000000000330044000044220000000022440000000000000033002200004422220000222244553333335555003300220000442222000022224455333333555500330022440044444455554444440000000000000033002244004444445555444444000000000000000000440000550000000000004422442244000000000044000055000000000000442244224400005555004400005500003333000044000000440000555500440000550000333300004400000044000000550044000055000000000000000000004400000055004400005500000000000000000000440000"
|
||||||
0000000000000000000000000000000000005555
|
|
||||||
0000000000000000000000000000000000005555
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
5555000000000000000000000000000000000000
|
|
||||||
5555000000000000000000000000000000000000
|
|
||||||
0055000000000000000000000000000000000000
|
|
||||||
0055000000000000000000000000000000000000
|
|
||||||
|
|||||||
@@ -1,30 +1,2 @@
|
|||||||
0000000000000000000000000000000000004400
|
points: [{index: -1, direction: right, team: radiant, type: eagle, y: 28, x: 0}, {index: 0, direction: right, team: radiant, type: tank, y: 2, x: 2}, {index: 1, direction: right, team: radiant, type: tank, y: 6, x: 2}, {index: 2, direction: right, team: radiant, type: tank, y: 10, x: 2}, {index: 3, direction: right, team: radiant, type: tank, y: 14, x: 2}, {index: 4, direction: right, team: radiant, type: tank, y: 18, x: 2}, {index: -1, direction: right, team: dire, type: eagle, y: 28, x: 38}, {index: 0, direction: left, team: dire, type: tank, y: 2, x: 36}, {index: 1, direction: left, team: dire, type: tank, y: 6, x: 36}, {index: 2, direction: left, team: dire, type: tank, y: 10, x: 36}, {index: 3, direction: left, team: dire, type: tank, y: 14, x: 36}, {index: 4, direction: left, team: dire, type: tank, y: 18, x: 36}]
|
||||||
0000000000000000000000000000000000004400
|
data: "005500330033003300333300330033003300550000550033003300330033330033003300330055000000000000330033000000003300330000000000000000000033003300000000330033000000000000550033000000330000000033000000330055000055003300000033000000003300000033005500000000330000003300333300330000003300000000000033000000330033330033000000330000000055000000330033003333003300330000005500005500000033003300333300330033000000550000000033003300330033330033003300330000000000003300330033003333003300330033000000005500330000003300333300330000003300550000550033000000330033330033000000330055000000000000330033003333003300330000000000000000000033003300333300330033000000000000550033003300330033330033003300330055000055003300330033003333003300330033005500000000330033003300333300330033003300000000000033003300330033330033003300330000005555553300330033003333003300330033555555555555330033003300333300330033003355555555555533003300330033330033003300335555555555553300330033003333003300330033555555440000330033000000333300000033000000004444000033003300000033330000003300000000440000443300330000003333000000330033440000000044330033000000333300000033003344000000440033003300330033330033003300330044000044003300330033003333003300330033004400"
|
||||||
0000000000000000000000000000000000004444
|
|
||||||
0000000000000000000000000000000000004444
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
0000000000000000000000000000000000000000
|
|
||||||
4444000000000000000000000000000000000000
|
|
||||||
4444000000000000000000000000000000000000
|
|
||||||
0044000000000000000000000000000000000000
|
|
||||||
0044000000000000000000000000000000000000
|
|
||||||
|
|||||||
2
src/client/resources/dota/levels/level002.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
data: "000000000000000000000000000000440000000000000000000000000000000000000044000000000044003300005500440000440055000000000000004400330000550044000044005500000000000000000000440000000000000000000055004400000000000044000000000000000000005500440000003300000000330044003300440000000000000000330000000033004400330044000000000000000000440055000000000000000000005500003300000044005500000000000000000000550000330000000000000055000044005500440000004400000000000000005500004400550044000000440000555500003300000000000000000000000000555555550000330000000000000000000000000055550055440000004400330000000000003300445500005544000000440033000000000000330044550055550000440000000044004400550000000055555555000044000000004400440055000000005555000000000000000000000000000044000044000000000000000000000000000000004400004400000044000044000044005500004400000000000000004400004400004400550000440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003300000000550000330055003300005500440000330000000055000033005500330000550044000000440033000000440000000000440000000000000044003300000044000000000044000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
|
||||||
|
points: [{direction: right, team: radiant, x: 0, type: eagle, y: 14, index: -1}, {direction: right, team: radiant, x: 0, type: tank, y: 0, index: 0}, {direction: right, team: radiant, x: 6, type: tank, y: 10, index: 1}, {direction: right, team: radiant, x: 6, type: tank, y: 16, index: 2}, {direction: right, team: radiant, x: 6, type: tank, y: 22, index: 3}, {direction: right, team: radiant, x: 10, type: tank, y: 28, index: 4}, {direction: right, team: dire, x: 38, type: eagle, y: 14, index: -1}, {direction: left, team: dire, x: 38, type: tank, y: 28, index: 0}, {direction: left, team: dire, x: 32, type: tank, y: 18, index: 1}, {direction: left, team: dire, x: 32, type: tank, y: 12, index: 2}, {direction: left, team: dire, x: 32, type: tank, y: 6, index: 3}, {direction: left, team: dire, x: 28, type: tank, y: 0, index: 4}]
|
||||||
2
src/client/resources/dota/levels/level003.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
points: [{index: -1, direction: right, team: radiant, x: 24, type: eagle, y: 26}, {index: 0, direction: right, team: radiant, x: 14, type: tank, y: 26}, {index: 1, direction: right, team: radiant, x: 20, type: tank, y: 20}, {index: 2, direction: right, team: radiant, x: 26, type: tank, y: 20}, {index: 3, direction: right, team: radiant, x: 34, type: tank, y: 24}, {index: 4, direction: right, team: radiant, x: 38, type: tank, y: 22}, {index: -1, direction: right, team: dire, x: 22, type: eagle, y: 2}, {index: 0, direction: left, team: dire, x: 8, type: tank, y: 2}, {index: 1, direction: left, team: dire, x: 12, type: tank, y: 6}, {index: 2, direction: left, team: dire, x: 20, type: tank, y: 6}, {index: 3, direction: left, team: dire, x: 21, type: tank, y: 10}, {index: 4, direction: left, team: dire, x: 28, type: tank, y: 4}]
|
||||||
|
data: "444444444400000000440000004444000000000044444444440000000044000000444400000000004444440000004444004400000044440033444400444444000000444400440000004444003344440000000000440000440044000000000000000000000000000044000044004400000000000000000000003344004400000000000044004444440000444400334400440000000000004400444444000044440000000000004400444444440033440000005544000000000000440044444444003344000000554444004433440044444400000000004400440000004400443344004444440000000000440044000000440000000000004444004444440044004444440044000000000000444400444444004400444444000000440055440044440044440000000055444400000044005544004444004444000000005544440000444400444400000000000000443300000000000044440044440000000000000044330000000000000044004444003300444444004444004433004400004400444400330044444400444400443300444400000000000033000000000000000044000000440000000000003300000000000000004400000044440044004444444400444444440000440044004444004400444444440044444444000044004400000000000000440000000000000000000000440000000000000044000000000000000000000044004455003344000000440044000000440033444400445500334400000044004400000044003344440044440000000044000000440000004400000000004444000000004400000044000000440000000000"
|
||||||
2
src/client/resources/dota/levels/level004.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
points: [{index: -1, direction: right, team: radiant, x: 12, type: eagle, y: 2}, {index: 0, direction: right, team: radiant, x: 6, type: tank, y: 6}, {index: 1, direction: right, team: radiant, x: 10, type: tank, y: 10}, {index: 2, direction: right, team: radiant, x: 14, type: tank, y: 10}, {index: 3, direction: right, team: radiant, x: 18, type: tank, y: 6}, {index: 4, direction: right, team: radiant, x: 20, type: tank, y: 2}, {index: -1, direction: right, team: dire, x: 22, type: eagle, y: 26}, {index: 0, direction: left, team: dire, x: 12, type: tank, y: 26}, {index: 1, direction: left, team: dire, x: 18, type: tank, y: 22}, {index: 2, direction: left, team: dire, x: 24, type: tank, y: 22}, {index: 3, direction: left, team: dire, x: 28, type: tank, y: 18}, {index: 4, direction: left, team: dire, x: 30, type: tank, y: 10}]
|
||||||
|
data: "000000000033333300000000000000000000000000000000003333330000000000000000000000000000004400330033004400000000003300000044000000440033003300440000000000330000004400000000003333330000000044440000000000000000000000333333000000004444000000000000000000000000000000003300000000004444000000000000000000000000330000000000444400000044000000004400000000004400000044000000004400000000440000000000440000004400000000000033000000000000004444000000000000000000003300000000000000444400000000000000000000000000330000440000000033000000000000000000000033000044000000003300000000000000000000000000444400004400000000000000000000000000000044440000440000000000000000000000334444004444000000000044000000000000000033444400444400000000004400000000004400000044000000000000330000440000000000440000004400000000000033000044000000000000440000000000330000440000000000000033000044000000000033000044000000000000003300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044000000003333330000000033000000000000004400000000333333000000003300000000000000000000440033003300440000000000000000000000000044003300330044000000000000000000000000000000333333000000000000000000000000000000000033333300000000000000"
|
||||||
2
src/client/resources/dota/levels/level005.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
points: [{index: -1, direction: right, team: radiant, x: 19, type: eagle, y: 28}, {index: 0, direction: right, team: radiant, x: 0, type: tank, y: 28}, {index: 1, direction: right, team: radiant, x: 10, type: tank, y: 22}, {index: 2, direction: right, team: radiant, x: 19, type: tank, y: 18}, {index: 3, direction: right, team: radiant, x: 28, type: tank, y: 22}, {index: 4, direction: right, team: radiant, x: 38, type: tank, y: 28}, {index: -1, direction: right, team: dire, x: 19, type: eagle, y: 0}, {index: 0, direction: left, team: dire, x: 0, type: tank, y: 0}, {index: 1, direction: left, team: dire, x: 10, type: tank, y: 6}, {index: 2, direction: left, team: dire, x: 19, type: tank, y: 10}, {index: 3, direction: left, team: dire, x: 28, type: tank, y: 6}, {index: 4, direction: left, team: dire, x: 38, type: tank, y: 0}]
|
||||||
|
data: "000000000000440000000000004400000000000000000000000044000000000000440000000000004400000000000000000440000000000000000044440000000000000000044000000000000000004400000000005555555555555555555500000000000000000000555555555555555555550000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000550000000000000000000000000000000000000055000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004400000000000000000000440000000000000000440000000000000000000044000000005555555544333333333553333333334455555555555555554433333333355333333333445555555500000000440000000000000000000044000000000000000044000000000000000000004400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000550000000000000000000000000000000000000055000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000055555555555555555555000000000000000000005555555555555555555500000000004400000000000000000440000000000000000044440000000000000000044000000000000000004400000000000044000000000000440000000000000000000000004400000000000044000000000000"
|
||||||
2
src/client/resources/dota/levels/level006.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
points: [{index: -1, direction: right, team: radiant, x: 19, type: eagle, y: 28}, {index: 0, direction: right, team: radiant, x: 2, type: tank, y: 22}, {index: 1, direction: right, team: radiant, x: 9, type: tank, y: 20}, {index: 2, direction: right, team: radiant, x: 19, type: tank, y: 24}, {index: 3, direction: right, team: radiant, x: 29, type: tank, y: 20}, {index: 4, direction: right, team: radiant, x: 36, type: tank, y: 22}, {index: -1, direction: right, team: dire, x: 19, type: eagle, y: 0}, {index: 0, direction: left, team: dire, x: 2, type: tank, y: 6}, {index: 1, direction: left, team: dire, x: 9, type: tank, y: 8}, {index: 2, direction: left, team: dire, x: 19, type: tank, y: 4}, {index: 3, direction: left, team: dire, x: 29, type: tank, y: 8}, {index: 4, direction: left, team: dire, x: 36, type: tank, y: 6}]
|
||||||
|
data: "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005555555544444455555555000000000000000000555555554444445555555500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005500000000000000550000000000000000000000550000000000000055000000000000000000000055000000000000005500000000000000000000005500000000000000550000000000000000000000000044000000440000000000000000000000000000004400000044000000000000000333333333333333445500004433333333333333333333333333333344550000443333333333333333333333333333334400440044333333333333333333333333333333440044004433333333333333333333333333333344000055443333333333333333333333333333334400005544333333333333333000000000000000440000004400000000000000000000000000000044000000440000000000000000000000000055000000000000005500000000000000000000005500000000000000550000000000000000000000550000000000000055000000000000000000000055000000000000005500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005555555544444455555555000000000000000000555555554444445555555500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
|
||||||
2
src/client/resources/dota/levels/level007.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
data: "444455555555555555555555555555555555444444445555555555555555555555555555555544440044004444444400444444440044444444004400004400444444440044444444004444444400440000220000000000000000000000000000000022000022000000000000000000000000000000002200004400444444442244444444224444444400440000440044444444224444444422444444440044000011000033550000000000000000553300001100001100003355000000000000000055330000110000110000444444004444444400444444440011000011000044444400444444440044444444001100004400000000000055333355000000000000440000440000000000005533335500000000000044000000442244444400443333440044444422440000000044224444440044333344004444442244000000440000000000005533335500000000000044000044000000000000553333550000000000004400001100444444440044444444004444444400110000110044444444004444444400444444440011000011000033550000000000000000553300001100001100003355000000000000000055330000110000440044444444224444444422444444440044000044004444444422444444442244444444004400002200000000000000000000000000000000220000220000000000000000000000000000000022000044004444444400444444440044444440004400004400444444440044444444004444444000440044445555555555555555555555555555555544444444555555555555555555555555555555554444"
|
||||||
|
points: [{team: radiant, direction: right, x: 2, type: eagle, y: 14, index: -1}, {team: radiant, direction: right, x: 14, type: tank, y: 2, index: 0}, {team: radiant, direction: right, x: 6, type: tank, y: 8, index: 1}, {team: radiant, direction: right, x: 14, type: tank, y: 14, index: 2}, {team: radiant, direction: right, x: 6, type: tank, y: 20, index: 3}, {team: radiant, direction: right, x: 14, type: tank, y: 26, index: 4}, {team: dire, direction: right, x: 36, type: eagle, y: 14, index: -1}, {team: dire, direction: left, x: 24, type: tank, y: 2, index: 0}, {team: dire, direction: left, x: 32, type: tank, y: 8, index: 1}, {team: dire, direction: left, x: 24, type: tank, y: 14, index: 2}, {team: dire, direction: left, x: 32, type: tank, y: 20, index: 3}, {team: dire, direction: left, x: 24, type: tank, y: 26, index: 4}]
|
||||||
|
Before Width: | Height: | Size: 110 B After Width: | Height: | Size: 110 B |
|
Before Width: | Height: | Size: 141 B After Width: | Height: | Size: 141 B |
|
Before Width: | Height: | Size: 144 B After Width: | Height: | Size: 144 B |
|
Before Width: | Height: | Size: 186 B After Width: | Height: | Size: 186 B |
|
Before Width: | Height: | Size: 144 B After Width: | Height: | Size: 144 B |
|
Before Width: | Height: | Size: 186 B After Width: | Height: | Size: 186 B |
|
Before Width: | Height: | Size: 144 B After Width: | Height: | Size: 144 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 292 B After Width: | Height: | Size: 292 B |
|
Before Width: | Height: | Size: 386 B After Width: | Height: | Size: 386 B |
|
Before Width: | Height: | Size: 450 B After Width: | Height: | Size: 450 B |
|
Before Width: | Height: | Size: 566 B After Width: | Height: | Size: 566 B |
|
Before Width: | Height: | Size: 354 B After Width: | Height: | Size: 354 B |
|
Before Width: | Height: | Size: 541 B After Width: | Height: | Size: 541 B |
|
Before Width: | Height: | Size: 455 B After Width: | Height: | Size: 455 B |
|
Before Width: | Height: | Size: 532 B After Width: | Height: | Size: 532 B |
|
Before Width: | Height: | Size: 389 B After Width: | Height: | Size: 389 B |
|
Before Width: | Height: | Size: 375 B After Width: | Height: | Size: 375 B |
|
Before Width: | Height: | Size: 374 B After Width: | Height: | Size: 374 B |
BIN
src/client/resources/image/eagle/eagle-protected.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 737 B After Width: | Height: | Size: 737 B |
|
Before Width: | Height: | Size: 307 B After Width: | Height: | Size: 307 B |
|
Before Width: | Height: | Size: 304 B After Width: | Height: | Size: 304 B |
|
Before Width: | Height: | Size: 279 B After Width: | Height: | Size: 279 B |
|
Before Width: | Height: | Size: 969 B After Width: | Height: | Size: 969 B |
|
Before Width: | Height: | Size: 93 B After Width: | Height: | Size: 93 B |
|
Before Width: | Height: | Size: 598 B After Width: | Height: | Size: 598 B |
|
Before Width: | Height: | Size: 531 B After Width: | Height: | Size: 531 B |
|
Before Width: | Height: | Size: 598 B After Width: | Height: | Size: 598 B |
BIN
src/client/resources/image/tank/ba-0.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
src/client/resources/image/tank/ba-1.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
src/client/resources/image/tank/bb-0.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
src/client/resources/image/tank/bb-1.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
src/client/resources/image/tank/bc-0.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
src/client/resources/image/tank/bc-1.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
src/client/resources/image/tank/bd-0.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/client/resources/image/tank/bd-1.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/client/resources/image/tank/pa-0.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
src/client/resources/image/tank/pa-1.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
src/client/resources/image/tank/pb-0.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/client/resources/image/tank/pb-1.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/client/resources/image/tank/pc-0.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
src/client/resources/image/tank/pc-1.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
src/client/resources/image/tank/pd-0.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
src/client/resources/image/tank/pd-1.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |