looks like battle animations to me
This commit is contained in:
parent
64a74d6f36
commit
b0e718f879
|
@ -126,6 +126,7 @@
|
||||||
{"id":{"name":"c_selectunit","path":"scripts/c_selectunit/c_selectunit.yy",},"order":9,},
|
{"id":{"name":"c_selectunit","path":"scripts/c_selectunit/c_selectunit.yy",},"order":9,},
|
||||||
{"id":{"name":"array_generate_2d","path":"scripts/array_generate_2d/array_generate_2d.yy",},"order":3,},
|
{"id":{"name":"array_generate_2d","path":"scripts/array_generate_2d/array_generate_2d.yy",},"order":3,},
|
||||||
{"id":{"name":"c_input","path":"scripts/c_input/c_input.yy",},"order":8,},
|
{"id":{"name":"c_input","path":"scripts/c_input/c_input.yy",},"order":8,},
|
||||||
|
{"id":{"name":"o_damage","path":"objects/o_damage/o_damage.yy",},"order":4,},
|
||||||
{"id":{"name":"st_standing","path":"scripts/st_standing/st_standing.yy",},"order":6,},
|
{"id":{"name":"st_standing","path":"scripts/st_standing/st_standing.yy",},"order":6,},
|
||||||
{"id":{"name":"unit","path":"scripts/unit/unit.yy",},"order":2,},
|
{"id":{"name":"unit","path":"scripts/unit/unit.yy",},"order":2,},
|
||||||
{"id":{"name":"c_moveunit","path":"scripts/c_moveunit/c_moveunit.yy",},"order":17,},
|
{"id":{"name":"c_moveunit","path":"scripts/c_moveunit/c_moveunit.yy",},"order":17,},
|
||||||
|
|
|
@ -8,6 +8,7 @@ var i;
|
||||||
|
|
||||||
c_loadstageone();
|
c_loadstageone();
|
||||||
|
|
||||||
|
waiting = 0;
|
||||||
selectedunit = noone;
|
selectedunit = noone;
|
||||||
hoveredunit = noone;
|
hoveredunit = noone;
|
||||||
hspd = 0;
|
hspd = 0;
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
amount = 0;
|
||||||
|
count = 0;
|
||||||
|
hspd = 0;
|
||||||
|
vspd = 0;
|
|
@ -0,0 +1,16 @@
|
||||||
|
cpp();
|
||||||
|
draw_set_color(c_black);
|
||||||
|
//draw_set_alpha(0.25);
|
||||||
|
//draw_circle(x,y,5,false);
|
||||||
|
//draw_set_alpha(1);
|
||||||
|
var worldMat = matrix_get(matrix_world);
|
||||||
|
//this is the location of where i want to draw from !!!
|
||||||
|
var worldMat2 = matrix_build(x,y+6,0,50,0,0,0.6,0.6,0.6);
|
||||||
|
matrix_set(matrix_world,worldMat2);
|
||||||
|
draw_set_halign(fa_center);
|
||||||
|
draw_text(0, 0, amount);
|
||||||
|
draw_set_halign(fa_left);
|
||||||
|
//draw_set_color(c_red);
|
||||||
|
//draw_circle(x, y, 5, false);
|
||||||
|
|
||||||
|
matrix_set(matrix_world,worldMat);
|
|
@ -0,0 +1,7 @@
|
||||||
|
vspd -= .2;
|
||||||
|
x += hspd;
|
||||||
|
y += vspd;
|
||||||
|
if count >= 40 {
|
||||||
|
image_alpha -= .1;
|
||||||
|
if !image_alpha instance_destroy();
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
"spriteId": null,
|
||||||
|
"solid": false,
|
||||||
|
"visible": true,
|
||||||
|
"spriteMaskId": null,
|
||||||
|
"persistent": false,
|
||||||
|
"parentObjectId": null,
|
||||||
|
"physicsObject": false,
|
||||||
|
"physicsSensor": false,
|
||||||
|
"physicsShape": 1,
|
||||||
|
"physicsGroup": 1,
|
||||||
|
"physicsDensity": 0.5,
|
||||||
|
"physicsRestitution": 0.1,
|
||||||
|
"physicsLinearDamping": 0.1,
|
||||||
|
"physicsAngularDamping": 0.1,
|
||||||
|
"physicsFriction": 0.2,
|
||||||
|
"physicsStartAwake": true,
|
||||||
|
"physicsKinematic": false,
|
||||||
|
"physicsShapePoints": [],
|
||||||
|
"eventList": [
|
||||||
|
{"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",},
|
||||||
|
{"isDnD":false,"eventNum":0,"eventType":8,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",},
|
||||||
|
{"isDnD":false,"eventNum":0,"eventType":3,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",},
|
||||||
|
],
|
||||||
|
"properties": [],
|
||||||
|
"overriddenProperties": [],
|
||||||
|
"parent": {
|
||||||
|
"name": "Objects",
|
||||||
|
"path": "folders/Objects.yy",
|
||||||
|
},
|
||||||
|
"resourceVersion": "1.0",
|
||||||
|
"name": "o_damage",
|
||||||
|
"tags": [],
|
||||||
|
"resourceType": "GMObject",
|
||||||
|
}
|
|
@ -28,11 +28,15 @@ continuecombat = function(me, them) {
|
||||||
|
|
||||||
action = {
|
action = {
|
||||||
effect: function(me, them) {
|
effect: function(me, them) {
|
||||||
|
var guy = instance_create(them.x, them.y, o_damage);
|
||||||
|
guy.hspd = random(3)-1.5;
|
||||||
|
guy.vspd = -random(1)-3;
|
||||||
if irandom(99) < (me.data.hit.val) { //add avo
|
if irandom(99) < (me.data.hit.val) { //add avo
|
||||||
them.data.hp.val -= (me.data.str.val-them.data.def.val);
|
them.data.hp.val -= (me.data.str.val-them.data.def.val);
|
||||||
|
guy.amount = (me.data.str.val-them.data.def.val);
|
||||||
return me.data.str.val;
|
return me.data.str.val;
|
||||||
} else {
|
} else {
|
||||||
log(string(me) + " missed!");
|
guy.amount = "Miss!";
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,6 +97,7 @@ function c_doenemyai(target) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
c_loadmarkings();
|
c_loadmarkings();
|
||||||
|
waiting = 70;
|
||||||
}
|
}
|
||||||
|
|
||||||
function c_findnearestunit(alignment) {
|
function c_findnearestunit(alignment) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
function c_moveunit(targetunit, destination) {
|
function c_moveunit(targetunit, destination) {
|
||||||
var theguy = c_gettile(targetunit.pos.x, targetunit.pos.y);
|
var theguy = c_gettile(targetunit.pos.x, targetunit.pos.y);
|
||||||
log(theguy.contents);
|
log(theguy.contents);
|
||||||
if !array_remove(theguy.contents, targetunit) idhfnjg();
|
/*if !*/array_remove(theguy.contents, targetunit) //idhfnjg();
|
||||||
array_push(destination.contents, targetunit);
|
array_push(destination.contents, targetunit);
|
||||||
targetunit.pos.x = destination.x;
|
targetunit.pos.x = destination.x;
|
||||||
targetunit.pos.y = destination.y;
|
targetunit.pos.y = destination.y;
|
||||||
|
|
|
@ -73,6 +73,7 @@ function st_control() {
|
||||||
}
|
}
|
||||||
c_dewait(global.turn);
|
c_dewait(global.turn);
|
||||||
//global.turn = (global.turn+1)%2;
|
//global.turn = (global.turn+1)%2;
|
||||||
|
k = 0;
|
||||||
global.turn = ARMY.THEM;
|
global.turn = ARMY.THEM;
|
||||||
log("TURN " + string(global.turn));
|
log("TURN " + string(global.turn));
|
||||||
state = st_enemyturn;
|
state = st_enemyturn;
|
||||||
|
|
|
@ -1,19 +1,36 @@
|
||||||
function st_enemyturn() {
|
function st_enemyturn() {
|
||||||
while global.turn == ARMY.THEM {
|
if selectedunit != noone {
|
||||||
var done = true;
|
hspd = 0;
|
||||||
for (k=0; k<array_length(global.units[ARMY.THEM]); k++) {
|
vspd = 0;
|
||||||
var target = global.units[ARMY.THEM][k];
|
x = lerp(x, selectedunit.x, .4);
|
||||||
if !target.waiting {
|
y = lerp(y, selectedunit.y, .4);
|
||||||
|
cursor.x = mouse_x;
|
||||||
|
cursor.y = mouse_y;
|
||||||
|
global.camerax = x;
|
||||||
|
global.cameray = y;
|
||||||
|
}
|
||||||
|
if waiting {
|
||||||
|
waiting--;
|
||||||
|
exit;
|
||||||
|
}
|
||||||
done = false;
|
done = false;
|
||||||
} else {
|
//for (k=0; k<array_length(global.units[ARMY.THEM]); k++) {
|
||||||
continue;
|
var target = global.units[ARMY.THEM][k];
|
||||||
}
|
selectedunit = target;
|
||||||
|
while !target.waiting {
|
||||||
c_doenemyai(target);
|
c_doenemyai(target);
|
||||||
|
if waiting exit;
|
||||||
}
|
}
|
||||||
|
k++;
|
||||||
|
if k >= array_length(global.units[ARMY.THEM]){
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
//}
|
||||||
if done {
|
if done {
|
||||||
c_dewait(global.turn);
|
c_dewait(global.turn);
|
||||||
|
k = 0;
|
||||||
state = st_control;
|
state = st_control;
|
||||||
global.turn = ARMY.US;
|
global.turn = ARMY.US;
|
||||||
}
|
}
|
||||||
}
|
//}
|
||||||
}
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
function st_standing() {
|
function st_standing() {
|
||||||
x = pos.x*global.tilesize.x+global.tilesize.x/2;
|
x = lerp(x, pos.x*global.tilesize.x+global.tilesize.x/2, .1);
|
||||||
y = pos.y*global.tilesize.y+global.tilesize.y/2;
|
y = lerp(y, pos.y*global.tilesize.y+global.tilesize.y/2, .1);
|
||||||
//log(x, y);
|
//log(x, y);
|
||||||
}
|
}
|
Loading…
Reference in New Issue