Compare commits

..

2 Commits

12 changed files with 36 additions and 34 deletions

View File

@ -1,4 +1,5 @@
c_addunit(un.chara, ARMY.US); c_addunit(un.chara, ARMY.US);
c_addunit(un.kris, ARMY.THEM);
var i; var i;
/*for (i=0; i<array_length(global.units[ARMY.US]); i++) { /*for (i=0; i<array_length(global.units[ARMY.US]); i++) {
c_inheritunit(2+i, 2, un.chara); c_inheritunit(2+i, 2, un.chara);
@ -10,6 +11,8 @@ var kris = c_inheritunit(10, 5, un.kris);
c_addweapon(kris, wp[$"iron sword"], true); c_addweapon(kris, wp[$"iron sword"], true);
selectedunit = noone; selectedunit = noone;
hoveredunit = noone; hoveredunit = noone;
hspd = 0;
vspd = 0;
global.gw = 640; global.gw = 640;
global.gh = 360; global.gh = 360;
global.camerax = 0; global.camerax = 0;

View File

@ -27,7 +27,21 @@ if select && selectedunit == noone {
//draw_text(global.gw-10, global.gh-10-i*20; //draw_text(global.gw-10, global.gh-10-i*20;
} }
} }
if selectedunit == noone {
hspd = lerp(hspd, (right-left)*((.1+stop*.1)*(ts.x)), .4);
vspd = lerp(vspd, (down-up)*((.1+stop*.1)*(ts.y)), .4);
x += hspd;
y += vspd;
} else {
hspd = 0;
vspd = 0;
x = lerp(x, selectedunit.x, .4);
y = lerp(y, selectedunit.y, .4);
}
global.camerax = x;
global.cameray = y;
var mousex = floor(mouse.x/global.tilesize.x); var mousex = floor(mouse.x/global.tilesize.x);
var mousey = floor(mouse.y/global.tilesize.y); var mousey = floor(mouse.y/global.tilesize.y);
//log(mousex, mousey); //log(mousex, mousey);
@ -42,15 +56,3 @@ if mousex < array_length(global.map) && mousex >= 0 {
} }
} }
} }
if(left){
global.camerax--;
}
if(right){
global.camerax++;
}
if(up){
global.cameray--;
}
if(down){
global.cameray++;
}

View File

@ -17,11 +17,11 @@ x = tempx;
y = tempy; y = tempy;
//log(data); //log(data);
draw_set_color(c_red); draw_set_color(c_red);
draw_rectangle(0-ts.x/2, 0-ts.y/2-1, draw_rectangle(0-ts.x/2, 0-sprite_height-1,
0-ts.x/2+(ts.x*(data.hp.val/data.hp.cap)), 0-ts.x/2+(ts.x*(data.hp.val/data.hp.cap)),
0-ts.y/2+1, false 0-sprite_height+1, false
); );
draw_text(x, y-ts.y, data.hp.val); draw_text(0, 0-sprite_height-4, data.hp.val);
//draw_set_color(c_red); //draw_set_color(c_red);
//draw_circle(x, y, 5, false); //draw_circle(x, y, 5, false);

View File

@ -10,6 +10,6 @@ function c_input() {
rightp = keyboard_check_pressed(ord("D")) + keyboard_check_pressed(vk_right); rightp = keyboard_check_pressed(ord("D")) + keyboard_check_pressed(vk_right);
select = mouse_check_button_pressed(mb_left) + keyboard_check_pressed(vk_enter); select = mouse_check_button_pressed(mb_left) + keyboard_check_pressed(vk_enter);
back = mouse_check_button_pressed(mb_right) + keyboard_check_pressed(vk_escape); back = mouse_check_button_pressed(mb_right) + keyboard_check_pressed(vk_escape) + keyboard_check_pressed(ord("Q"));
stop = keyboard_check(vk_shift); stop = keyboard_check(vk_shift);
} }

View File

@ -1,8 +1,8 @@
function st_moving() { function st_moving() {
var mov = data.mov.val; var mov = data.mov.val;
c_input(); c_input();
hspd = lerp(hspd, (right-left)*.05, .4); hspd = lerp(hspd, (right-left)*.07, .4);
vspd = lerp(vspd, (down-up)*.05, .4); vspd = lerp(vspd, (down-up)*.07, .4);
if !stop dir = DIR.NONE; if !stop dir = DIR.NONE;
if left dir = DIR.LEFT; if left dir = DIR.LEFT;
if down dir = DIR.DOWN; if down dir = DIR.DOWN;
@ -47,27 +47,23 @@ function st_moving() {
//var rng = [1]; //var rng = [1];
var guy = c_gettile(x, y, true); var guy = c_gettile(x, y, true);
var hitting = noone; var hitting = noone;
if guy != noone && stop { if guy != noone {
switch dir { switch dir {
case DIR.LEFT: case DIR.LEFT:
hitting = c_gettile(guy.x-1, guy.y); hitting = c_gettile(guy.x-1, guy.y);
c_colortile(guy.x-1, guy.y, c_red);
sprite_index = data.down; sprite_index = data.down;
image_xscale = -1; image_xscale = -1;
break; break;
case DIR.DOWN: case DIR.DOWN:
hitting = c_gettile(guy.x, guy.y+1); hitting = c_gettile(guy.x, guy.y+1);
c_colortile(guy.x, guy.y+1, c_red);
sprite_index = data.down; sprite_index = data.down;
break; break;
case DIR.UP: case DIR.UP:
hitting = c_gettile(guy.x, guy.y-1); hitting = c_gettile(guy.x, guy.y-1);
c_colortile(guy.x, guy.y-1, c_red);
sprite_index = data.up; sprite_index = data.up;
break; break;
case DIR.RIGHT: case DIR.RIGHT:
hitting = c_gettile(guy.x+1, guy.y); hitting = c_gettile(guy.x+1, guy.y);
c_colortile(guy.x+1, guy.y, c_red);
sprite_index = data.down; sprite_index = data.down;
image_xscale = 1; image_xscale = 1;
break; break;
@ -77,7 +73,8 @@ function st_moving() {
break; break;
} }
if hitting != noone && select { if hitting != noone && select && stop {
c_colortile(hitting.x, hitting.y, c_red);
log("found one"); log("found one");
log(hitting.contents, hitting.x, hitting.y); log(hitting.contents, hitting.x, hitting.y);
var i; var i;

View File

@ -24,7 +24,7 @@ function c_informtiles() {
} }
} }
c_informtiles(); c_informtiles();
global.tilesize = new vec2(32, 32); global.tilesize = new vec2(20, 20);
function tiledata(passable_=true, contents_=[], overlays_=[], statmods=[]) constructor { function tiledata(passable_=true, contents_=[], overlays_=[], statmods=[]) constructor {
passable = passable_; passable = passable_;

View File

@ -2,7 +2,7 @@
"bboxMode": 0, "bboxMode": 0,
"collisionKind": 0, "collisionKind": 0,
"type": 0, "type": 0,
"origin": 4, "origin": 7,
"preMultiplyAlpha": false, "preMultiplyAlpha": false,
"edgeFiltering": false, "edgeFiltering": false,
"collisionTolerance": 0, "collisionTolerance": 0,
@ -55,7 +55,7 @@
"backdropXOffset": 0.0, "backdropXOffset": 0.0,
"backdropYOffset": 0.0, "backdropYOffset": 0.0,
"xorigin": 16, "xorigin": 16,
"yorigin": 16, "yorigin": 32,
"eventToFunction": {}, "eventToFunction": {},
"eventStubScript": null, "eventStubScript": null,
"parent": {"name":"s_guy","path":"sprites/s_guy/s_guy.yy",}, "parent": {"name":"s_guy","path":"sprites/s_guy/s_guy.yy",},

View File

@ -2,7 +2,7 @@
"bboxMode": 0, "bboxMode": 0,
"collisionKind": 0, "collisionKind": 0,
"type": 0, "type": 0,
"origin": 4, "origin": 9,
"preMultiplyAlpha": false, "preMultiplyAlpha": false,
"edgeFiltering": false, "edgeFiltering": false,
"collisionTolerance": 0, "collisionTolerance": 0,
@ -59,7 +59,7 @@
"backdropXOffset": 0.0, "backdropXOffset": 0.0,
"backdropYOffset": 0.0, "backdropYOffset": 0.0,
"xorigin": 16, "xorigin": 16,
"yorigin": 16, "yorigin": 27,
"eventToFunction": {}, "eventToFunction": {},
"eventStubScript": null, "eventStubScript": null,
"parent": {"name":"s_momiji","path":"sprites/s_momiji/s_momiji.yy",}, "parent": {"name":"s_momiji","path":"sprites/s_momiji/s_momiji.yy",},

View File

@ -2,7 +2,7 @@
"bboxMode": 0, "bboxMode": 0,
"collisionKind": 0, "collisionKind": 0,
"type": 0, "type": 0,
"origin": 4, "origin": 9,
"preMultiplyAlpha": false, "preMultiplyAlpha": false,
"edgeFiltering": false, "edgeFiltering": false,
"collisionTolerance": 0, "collisionTolerance": 0,
@ -67,7 +67,7 @@
"backdropXOffset": 0.0, "backdropXOffset": 0.0,
"backdropYOffset": 0.0, "backdropYOffset": 0.0,
"xorigin": 16, "xorigin": 16,
"yorigin": 16, "yorigin": 28,
"eventToFunction": {}, "eventToFunction": {},
"eventStubScript": null, "eventStubScript": null,
"parent": {"name":"s_momijidown","path":"sprites/s_momijidown/s_momijidown.yy",}, "parent": {"name":"s_momijidown","path":"sprites/s_momijidown/s_momijidown.yy",},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 539 B

After

Width:  |  Height:  |  Size: 548 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 539 B

After

Width:  |  Height:  |  Size: 548 B

View File

@ -2,7 +2,7 @@
"bboxMode": 0, "bboxMode": 0,
"collisionKind": 0, "collisionKind": 0,
"type": 0, "type": 0,
"origin": 4, "origin": 9,
"preMultiplyAlpha": false, "preMultiplyAlpha": false,
"edgeFiltering": false, "edgeFiltering": false,
"collisionTolerance": 0, "collisionTolerance": 0,
@ -10,7 +10,7 @@
"bbox_left": 5, "bbox_left": 5,
"bbox_right": 22, "bbox_right": 22,
"bbox_top": 3, "bbox_top": 3,
"bbox_bottom": 26, "bbox_bottom": 27,
"HTile": false, "HTile": false,
"VTile": false, "VTile": false,
"For3D": false, "For3D": false,
@ -67,7 +67,7 @@
"backdropXOffset": 0.0, "backdropXOffset": 0.0,
"backdropYOffset": 0.0, "backdropYOffset": 0.0,
"xorigin": 16, "xorigin": 16,
"yorigin": 16, "yorigin": 26,
"eventToFunction": {}, "eventToFunction": {},
"eventStubScript": null, "eventStubScript": null,
"parent": {"name":"s_momijiup","path":"sprites/s_momijiup/s_momijiup.yy",}, "parent": {"name":"s_momijiup","path":"sprites/s_momijiup/s_momijiup.yy",},