Compare commits
3 Commits
v0.18.0
...
b24c71678e
| Author | SHA1 | Date | |
|---|---|---|---|
| b24c71678e | |||
| c34308ed7c | |||
| a3be62eec7 |
@@ -1,9 +1,11 @@
|
||||
# Tankz
|
||||
# Tank'z
|
||||
|
||||

|
||||
|
||||
## Play
|
||||
|
||||
https://shmyga.ru/tankz/html5/index.html
|
||||
|
||||
## Packages
|
||||
## Releases
|
||||
|
||||
https://git.shmyga.ru/InfernalGames/-/packages/generic/tankz
|
||||
https://git.shmyga.ru/InfernalGames/tankz/releases
|
||||
|
||||
BIN
docs/Screenshot_2026-05-04_16-22-53.png
Normal file
BIN
docs/Screenshot_2026-05-04_16-22-53.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 50 KiB |
243
gulpfile.js
243
gulpfile.js
@@ -1,26 +1,28 @@
|
||||
const gulp = require('gulp');
|
||||
const gulpClean = require('gulp-clean');
|
||||
const Config = require('./config.json');
|
||||
const packageInfo = require('./package.json');
|
||||
const {System, Sdk, Haxe, Project} = require('gulp-haxetool');
|
||||
const dateformat = require('dateformat');
|
||||
const argv = require('yargs').argv;
|
||||
const publish = require('./tasks/gulp-publish');
|
||||
const gulp = require("gulp");
|
||||
const gulpClean = require("gulp-clean");
|
||||
const Config = require("./config.json");
|
||||
const packageInfo = require("./package.json");
|
||||
const { System, Sdk, Haxe, Project } = require("gulp-haxetool");
|
||||
const dateformat = require("dateformat");
|
||||
const argv = require("yargs").argv;
|
||||
const publish = require("./tasks/gulp-publish");
|
||||
|
||||
Project.useRuffle();
|
||||
|
||||
if (packageInfo.haxe) {
|
||||
Haxe.VERSION = packageInfo.haxe;
|
||||
Haxe.VERSION = packageInfo.haxe;
|
||||
}
|
||||
|
||||
if (Config.SdkDir) {
|
||||
Sdk.dir = Config.SdkDir;
|
||||
Sdk.dir = Config.SdkDir;
|
||||
}
|
||||
|
||||
if (Config.BuildDir) {
|
||||
Haxe.buildDir = Config.BuildDir;
|
||||
Haxe.buildDir = Config.BuildDir;
|
||||
}
|
||||
|
||||
exports.clean = function clean() {
|
||||
return gulp.src('target/*', {read: false}).pipe(gulpClean());
|
||||
return gulp.src("target/*", { read: false }).pipe(gulpClean());
|
||||
};
|
||||
|
||||
exports.setup = function setup() {
|
||||
@@ -48,167 +50,146 @@ exports.generate = function generate() {
|
||||
* base config
|
||||
*/
|
||||
const config = new Project.Config({
|
||||
meta: {
|
||||
title: 'Tank\'z',
|
||||
filename: 'tankz',
|
||||
icon: 'src/client/resources/icon.png',
|
||||
pack: 'ru.m.tankz',
|
||||
author: 'shmyga <shmyga.z@gmail.com>',
|
||||
company: 'MegaLoMania',
|
||||
version: packageInfo.version + (Config.Develop ? '-SNAPSHOT' : ''),
|
||||
},
|
||||
key: Config.Key,
|
||||
libs: packageInfo.haxeDependencies,
|
||||
sources: [
|
||||
'src/common/haxe',
|
||||
'src-gen/haxe',
|
||||
],
|
||||
assets: [
|
||||
'src/common/resources/config',
|
||||
],
|
||||
flags: [
|
||||
'proto_debug',
|
||||
],
|
||||
macros: [
|
||||
`CompilationOption.set('build','${dateformat(new Date(), 'yyyy-mm-dd HH:MM:ss')}')`,
|
||||
]
|
||||
meta: {
|
||||
title: "Tank'z",
|
||||
filename: "tankz",
|
||||
icon: "src/client/resources/icon.png",
|
||||
pack: "ru.m.tankz",
|
||||
author: "shmyga <shmyga.z@gmail.com>",
|
||||
company: "MegaLoMania",
|
||||
version: packageInfo.version + (Config.Develop ? "-SNAPSHOT" : ""),
|
||||
},
|
||||
key: Config.Key,
|
||||
libs: packageInfo.haxeDependencies,
|
||||
sources: ["src/common/haxe", "src-gen/haxe"],
|
||||
assets: ["src/common/resources/config"],
|
||||
flags: ["proto_debug"],
|
||||
macros: [
|
||||
`CompilationOption.set('build','${dateformat(new Date(), "yyyy-mm-dd HH:MM:ss")}')`,
|
||||
],
|
||||
});
|
||||
|
||||
const host = argv.host || 'localhost';
|
||||
const host = argv.host || "localhost";
|
||||
const port = argv.port || 5000;
|
||||
|
||||
/**
|
||||
* client
|
||||
*/
|
||||
const client = new Project(
|
||||
Project.BuildSystem.OPENFL,
|
||||
[
|
||||
Project.Platform.FLASH,
|
||||
Project.Platform.HTML5,
|
||||
Project.Platform.LINUX,
|
||||
Project.Platform.WINDOWS,
|
||||
Project.Platform.ANDROID,
|
||||
Project.BuildSystem.OPENFL,
|
||||
[
|
||||
Project.Platform.FLASH,
|
||||
Project.Platform.HTML5,
|
||||
Project.Platform.LINUX,
|
||||
Project.Platform.WINDOWS,
|
||||
Project.Platform.ANDROID,
|
||||
],
|
||||
config.branch({
|
||||
name: "client",
|
||||
sources: ["src/client/haxe"],
|
||||
main: "ru.m.tankz.Client",
|
||||
preloader: "ru.m.tankz.Preloader",
|
||||
assets: ["src/common/resources/level", "src/client/resources"],
|
||||
meta: {
|
||||
width: 1024,
|
||||
height: 576,
|
||||
},
|
||||
flags: [
|
||||
//'proto_debug',
|
||||
//'dom',
|
||||
//'dev_layout',
|
||||
//'bitmap_text',
|
||||
],
|
||||
config.branch({
|
||||
name: 'client',
|
||||
sources: [
|
||||
'src/client/haxe',
|
||||
],
|
||||
main: 'ru.m.tankz.Client',
|
||||
preloader: 'ru.m.tankz.Preloader',
|
||||
assets: [
|
||||
'src/common/resources/level',
|
||||
'src/client/resources',
|
||||
],
|
||||
meta: {
|
||||
width: 1024,
|
||||
height: 576,
|
||||
},
|
||||
flags: [
|
||||
//'proto_debug',
|
||||
//'dom',
|
||||
//'dev_layout',
|
||||
//'bitmap_text',
|
||||
],
|
||||
macros: [
|
||||
`CompilationOption.set('host','${host}')`,
|
||||
`CompilationOption.set('port',${port})`,
|
||||
]
|
||||
}),
|
||||
macros: [
|
||||
`CompilationOption.set('host','${host}')`,
|
||||
`CompilationOption.set('port',${port})`,
|
||||
],
|
||||
}),
|
||||
).bind(module, gulp);
|
||||
|
||||
/**
|
||||
* editor
|
||||
*/
|
||||
const editor = new Project(
|
||||
Project.BuildSystem.OPENFL,
|
||||
[
|
||||
Project.Platform.FLASH,
|
||||
Project.Platform.HTML5,
|
||||
Project.Platform.LINUX,
|
||||
Project.BuildSystem.OPENFL,
|
||||
[Project.Platform.FLASH, Project.Platform.HTML5, Project.Platform.LINUX],
|
||||
config.branch({
|
||||
name: "editor",
|
||||
sources: ["src/client/haxe", "src/editor/haxe"],
|
||||
main: "ru.m.tankz.editor.Editor",
|
||||
preloader: "ru.m.tankz.Preloader",
|
||||
assets: ["src/client/resources", "src/editor/resources"],
|
||||
meta: {
|
||||
filename: "editor",
|
||||
pack: "ru.m.tankz.editor",
|
||||
width: 1024,
|
||||
height: 768,
|
||||
},
|
||||
flags: [
|
||||
//'dev_layout',
|
||||
],
|
||||
config.branch({
|
||||
name: 'editor',
|
||||
sources: [
|
||||
'src/client/haxe',
|
||||
'src/editor/haxe',
|
||||
],
|
||||
main: 'ru.m.tankz.editor.Editor',
|
||||
preloader: 'ru.m.tankz.Preloader',
|
||||
assets: [
|
||||
'src/client/resources',
|
||||
'src/editor/resources',
|
||||
],
|
||||
meta: {
|
||||
filename: 'editor',
|
||||
pack: 'ru.m.tankz.editor',
|
||||
width: 1024,
|
||||
height: 768,
|
||||
},
|
||||
flags: [
|
||||
//'dev_layout',
|
||||
]
|
||||
})
|
||||
}),
|
||||
).bind(module, gulp);
|
||||
|
||||
/**
|
||||
* server
|
||||
*/
|
||||
const server = new Project(
|
||||
Project.BuildSystem.HAXE,
|
||||
Project.Platform.CPP,
|
||||
config.branch({
|
||||
name: 'server',
|
||||
sources: ['src/server/haxe'],
|
||||
main: 'ru.m.tankz.server.Server',
|
||||
assets: [
|
||||
'src/common/resources/level',
|
||||
]
|
||||
}),
|
||||
Project.BuildSystem.HAXE,
|
||||
Project.Platform.CPP,
|
||||
config.branch({
|
||||
name: "server",
|
||||
sources: ["src/server/haxe"],
|
||||
main: "ru.m.tankz.server.Server",
|
||||
assets: ["src/common/resources/level"],
|
||||
}),
|
||||
).bind(module, gulp);
|
||||
|
||||
/**
|
||||
* publish
|
||||
*/
|
||||
module.exports.publish = publish(packageInfo.name, packageInfo.version, Config.PublishDir, Config.PublishUrl);
|
||||
module.exports.publish = publish(
|
||||
packageInfo.name,
|
||||
packageInfo.version,
|
||||
Config.PublishDir,
|
||||
Config.PublishUrl,
|
||||
);
|
||||
|
||||
/**
|
||||
* default
|
||||
*/
|
||||
const defaultSeries = [
|
||||
exports.clean,
|
||||
exports.generate,
|
||||
module.exports['client:flash:build'],
|
||||
module.exports['client:flash:html'],
|
||||
module.exports['client:html5:build'],
|
||||
exports.clean,
|
||||
exports.generate,
|
||||
module.exports["client:flash:build"],
|
||||
module.exports["client:flash:html"],
|
||||
module.exports["client:html5:build"],
|
||||
|
||||
module.exports['editor:flash:build'],
|
||||
module.exports['editor:flash:html'],
|
||||
module.exports['editor:html5:build'],
|
||||
module.exports["editor:flash:build"],
|
||||
module.exports["editor:flash:html"],
|
||||
module.exports["editor:html5:build"],
|
||||
|
||||
module.exports['server:cpp:build'],
|
||||
module.exports["server:cpp:build"],
|
||||
];
|
||||
|
||||
if (System.isLinux) {
|
||||
defaultSeries.push(
|
||||
module.exports['client:linux:build'],
|
||||
module.exports['client:linux:archive'],
|
||||
module.exports['client:linux:deb'],
|
||||
defaultSeries.push(
|
||||
module.exports["client:linux:build"],
|
||||
module.exports["client:linux:archive"],
|
||||
module.exports["client:linux:deb"],
|
||||
|
||||
module.exports['client:android:build'],
|
||||
);
|
||||
module.exports["client:android:build"],
|
||||
);
|
||||
}
|
||||
|
||||
if (System.isWindows) {
|
||||
defaultSeries.push(
|
||||
module.exports['client:windows:build'],
|
||||
module.exports['client:windows:archive'],
|
||||
module.exports['client:windows:installer'],
|
||||
);
|
||||
defaultSeries.push(
|
||||
module.exports["client:windows:build"],
|
||||
module.exports["client:windows:archive"],
|
||||
module.exports["client:windows:installer"],
|
||||
);
|
||||
}
|
||||
|
||||
defaultSeries.push(
|
||||
exports.publish,
|
||||
);
|
||||
defaultSeries.push(exports.publish);
|
||||
|
||||
module.exports.default = gulp.series(defaultSeries);
|
||||
|
||||
14741
package-lock.json
generated
14741
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@
|
||||
"gulp": "^4.0.0",
|
||||
"gulp-add": "0.0.2",
|
||||
"gulp-clean": "^0.4.0",
|
||||
"gulp-haxetool": "^0.1.9",
|
||||
"gulp-haxetool": "^0.2.1",
|
||||
"yargs": "^13.2.4"
|
||||
},
|
||||
"haxeDependencies": {
|
||||
|
||||
@@ -2,7 +2,116 @@ syntax = "proto3";
|
||||
|
||||
package ru.m.tankz.proto.game;
|
||||
|
||||
message PositionProto {
|
||||
float x = 1;
|
||||
float y = 2;
|
||||
}
|
||||
|
||||
message RectangleProto {
|
||||
float x = 1;
|
||||
float y = 2;
|
||||
float width = 3;
|
||||
float height = 4;
|
||||
}
|
||||
|
||||
message ShotProto {
|
||||
int32 tankId = 1;
|
||||
int32 bulletId = 2;
|
||||
int32 score = 3;
|
||||
}
|
||||
|
||||
message BrickProto {
|
||||
int32 gridX = 1;
|
||||
int32 gridY = 2;
|
||||
string type = 3;
|
||||
}
|
||||
|
||||
message EagleProto {
|
||||
string team = 1;
|
||||
}
|
||||
|
||||
message TankProto {
|
||||
string team = 1;
|
||||
int32 index = 2;
|
||||
string type = 3;
|
||||
int32 hits = 4;
|
||||
bool bonus = 5;
|
||||
int32 color = 6;
|
||||
string name = 7;
|
||||
}
|
||||
|
||||
message BulletProto {
|
||||
string team = 1;
|
||||
int32 index = 2;
|
||||
int32 piercing = 3;
|
||||
}
|
||||
|
||||
message BonusProto {
|
||||
string type = 1;
|
||||
}
|
||||
|
||||
message GameStateProto {
|
||||
string state = 1;
|
||||
}
|
||||
|
||||
message GameEventStartProto {
|
||||
GameStateProto state = 1;
|
||||
}
|
||||
|
||||
message GameEventCompleteProto {
|
||||
GameStateProto state = 1;
|
||||
}
|
||||
|
||||
message GameEventSpawnProto {
|
||||
int32 entityId = 1;
|
||||
RectangleProto rectangle = 2;
|
||||
oneof entity {
|
||||
EagleProto eagle = 3;
|
||||
TankProto tank = 4;
|
||||
BulletProto bullet = 5;
|
||||
BonusProto bonus = 6;
|
||||
BrickProto bricks = 7;
|
||||
}
|
||||
}
|
||||
|
||||
message GameEventMoveProto {
|
||||
int32 entityId = 1;
|
||||
PositionProto position = 2;
|
||||
}
|
||||
|
||||
message GameEventStopProto {
|
||||
int32 entityId = 1;
|
||||
}
|
||||
|
||||
message GameEventHitProto {
|
||||
int32 entityId = 1;
|
||||
ShotProto shot = 2;
|
||||
}
|
||||
|
||||
message GameEventDestroyProto {
|
||||
int32 entityId = 1;
|
||||
ShotProto shot = 2;
|
||||
}
|
||||
|
||||
message GameEventActionProto {
|
||||
int32 entityId = 1;
|
||||
oneof action {
|
||||
PositionProto move = 2;
|
||||
bool stop = 3;
|
||||
bool shot = 4;
|
||||
}
|
||||
}
|
||||
|
||||
message GameEventProto {
|
||||
int32 time = 1;
|
||||
string event = 2;
|
||||
oneof event {
|
||||
GameEventStartProto start = 2;
|
||||
GameEventCompleteProto complete = 3;
|
||||
GameEventSpawnProto spawn = 4;
|
||||
GameEventMoveProto move = 5;
|
||||
GameEventStopProto stop = 6;
|
||||
GameEventHitProto hit = 7;
|
||||
GameEventDestroyProto destroy = 8;
|
||||
GameEventActionProto action = 9;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user