Compare commits
No commits in common. "d8e6a82fdb5b0025a32b572615fe2df2435c0f68" and "53640e964ced091fbbfae7ec35cd3c15cd52297d" have entirely different histories.
d8e6a82fdb
...
53640e964c
|
@ -1,5 +1,4 @@
|
|||
c_addunit(un.chara, ARMY.US);
|
||||
c_addunit(un.kris, ARMY.THEM);
|
||||
var i;
|
||||
/*for (i=0; i<array_length(global.units[ARMY.US]); i++) {
|
||||
c_inheritunit(2+i, 2, un.chara);
|
||||
|
@ -11,8 +10,6 @@ var kris = c_inheritunit(10, 5, un.kris);
|
|||
c_addweapon(kris, wp[$"iron sword"], true);
|
||||
selectedunit = noone;
|
||||
hoveredunit = noone;
|
||||
hspd = 0;
|
||||
vspd = 0;
|
||||
global.gw = 640;
|
||||
global.gh = 360;
|
||||
global.camerax = 0;
|
||||
|
|
|
@ -27,21 +27,7 @@ if select && selectedunit == noone {
|
|||
//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 mousey = floor(mouse.y/global.tilesize.y);
|
||||
//log(mousex, mousey);
|
||||
|
@ -56,3 +42,15 @@ if mousex < array_length(global.map) && mousex >= 0 {
|
|||
}
|
||||
}
|
||||
}
|
||||
if(left){
|
||||
global.camerax--;
|
||||
}
|
||||
if(right){
|
||||
global.camerax++;
|
||||
}
|
||||
if(up){
|
||||
global.cameray--;
|
||||
}
|
||||
if(down){
|
||||
global.cameray++;
|
||||
}
|
|
@ -17,11 +17,11 @@ x = tempx;
|
|||
y = tempy;
|
||||
//log(data);
|
||||
draw_set_color(c_red);
|
||||
draw_rectangle(0-ts.x/2, 0-sprite_height-1,
|
||||
draw_rectangle(0-ts.x/2, 0-ts.y/2-1,
|
||||
0-ts.x/2+(ts.x*(data.hp.val/data.hp.cap)),
|
||||
0-sprite_height+1, false
|
||||
0-ts.y/2+1, false
|
||||
);
|
||||
draw_text(0, 0-sprite_height-4, data.hp.val);
|
||||
draw_text(x, y-ts.y, data.hp.val);
|
||||
//draw_set_color(c_red);
|
||||
//draw_circle(x, y, 5, false);
|
||||
|
||||
|
|
|
@ -10,6 +10,6 @@ function c_input() {
|
|||
rightp = keyboard_check_pressed(ord("D")) + keyboard_check_pressed(vk_right);
|
||||
|
||||
select = mouse_check_button_pressed(mb_left) + keyboard_check_pressed(vk_enter);
|
||||
back = mouse_check_button_pressed(mb_right) + keyboard_check_pressed(vk_escape) + keyboard_check_pressed(ord("Q"));
|
||||
back = mouse_check_button_pressed(mb_right) + keyboard_check_pressed(vk_escape);
|
||||
stop = keyboard_check(vk_shift);
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
function st_moving() {
|
||||
var mov = data.mov.val;
|
||||
c_input();
|
||||
hspd = lerp(hspd, (right-left)*.07, .4);
|
||||
vspd = lerp(vspd, (down-up)*.07, .4);
|
||||
hspd = lerp(hspd, (right-left)*.05, .4);
|
||||
vspd = lerp(vspd, (down-up)*.05, .4);
|
||||
if !stop dir = DIR.NONE;
|
||||
if left dir = DIR.LEFT;
|
||||
if down dir = DIR.DOWN;
|
||||
|
@ -47,23 +47,27 @@ function st_moving() {
|
|||
//var rng = [1];
|
||||
var guy = c_gettile(x, y, true);
|
||||
var hitting = noone;
|
||||
if guy != noone {
|
||||
if guy != noone && stop {
|
||||
switch dir {
|
||||
case DIR.LEFT:
|
||||
hitting = c_gettile(guy.x-1, guy.y);
|
||||
c_colortile(guy.x-1, guy.y, c_red);
|
||||
sprite_index = data.down;
|
||||
image_xscale = -1;
|
||||
break;
|
||||
case DIR.DOWN:
|
||||
hitting = c_gettile(guy.x, guy.y+1);
|
||||
c_colortile(guy.x, guy.y+1, c_red);
|
||||
sprite_index = data.down;
|
||||
break;
|
||||
case DIR.UP:
|
||||
hitting = c_gettile(guy.x, guy.y-1);
|
||||
c_colortile(guy.x, guy.y-1, c_red);
|
||||
sprite_index = data.up;
|
||||
break;
|
||||
case DIR.RIGHT:
|
||||
hitting = c_gettile(guy.x+1, guy.y);
|
||||
c_colortile(guy.x+1, guy.y, c_red);
|
||||
sprite_index = data.down;
|
||||
image_xscale = 1;
|
||||
break;
|
||||
|
@ -73,8 +77,7 @@ function st_moving() {
|
|||
break;
|
||||
|
||||
}
|
||||
if hitting != noone && select && stop {
|
||||
c_colortile(hitting.x, hitting.y, c_red);
|
||||
if hitting != noone && select {
|
||||
log("found one");
|
||||
log(hitting.contents, hitting.x, hitting.y);
|
||||
var i;
|
||||
|
|
|
@ -24,7 +24,7 @@ function c_informtiles() {
|
|||
}
|
||||
}
|
||||
c_informtiles();
|
||||
global.tilesize = new vec2(20, 20);
|
||||
global.tilesize = new vec2(32, 32);
|
||||
|
||||
function tiledata(passable_=true, contents_=[], overlays_=[], statmods=[]) constructor {
|
||||
passable = passable_;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"bboxMode": 0,
|
||||
"collisionKind": 0,
|
||||
"type": 0,
|
||||
"origin": 7,
|
||||
"origin": 4,
|
||||
"preMultiplyAlpha": false,
|
||||
"edgeFiltering": false,
|
||||
"collisionTolerance": 0,
|
||||
|
@ -55,7 +55,7 @@
|
|||
"backdropXOffset": 0.0,
|
||||
"backdropYOffset": 0.0,
|
||||
"xorigin": 16,
|
||||
"yorigin": 32,
|
||||
"yorigin": 16,
|
||||
"eventToFunction": {},
|
||||
"eventStubScript": null,
|
||||
"parent": {"name":"s_guy","path":"sprites/s_guy/s_guy.yy",},
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"bboxMode": 0,
|
||||
"collisionKind": 0,
|
||||
"type": 0,
|
||||
"origin": 9,
|
||||
"origin": 4,
|
||||
"preMultiplyAlpha": false,
|
||||
"edgeFiltering": false,
|
||||
"collisionTolerance": 0,
|
||||
|
@ -59,7 +59,7 @@
|
|||
"backdropXOffset": 0.0,
|
||||
"backdropYOffset": 0.0,
|
||||
"xorigin": 16,
|
||||
"yorigin": 27,
|
||||
"yorigin": 16,
|
||||
"eventToFunction": {},
|
||||
"eventStubScript": null,
|
||||
"parent": {"name":"s_momiji","path":"sprites/s_momiji/s_momiji.yy",},
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"bboxMode": 0,
|
||||
"collisionKind": 0,
|
||||
"type": 0,
|
||||
"origin": 9,
|
||||
"origin": 4,
|
||||
"preMultiplyAlpha": false,
|
||||
"edgeFiltering": false,
|
||||
"collisionTolerance": 0,
|
||||
|
@ -67,7 +67,7 @@
|
|||
"backdropXOffset": 0.0,
|
||||
"backdropYOffset": 0.0,
|
||||
"xorigin": 16,
|
||||
"yorigin": 28,
|
||||
"yorigin": 16,
|
||||
"eventToFunction": {},
|
||||
"eventStubScript": null,
|
||||
"parent": {"name":"s_momijidown","path":"sprites/s_momijidown/s_momijidown.yy",},
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 548 B After Width: | Height: | Size: 539 B |
Binary file not shown.
Before Width: | Height: | Size: 548 B After Width: | Height: | Size: 539 B |
|
@ -2,7 +2,7 @@
|
|||
"bboxMode": 0,
|
||||
"collisionKind": 0,
|
||||
"type": 0,
|
||||
"origin": 9,
|
||||
"origin": 4,
|
||||
"preMultiplyAlpha": false,
|
||||
"edgeFiltering": false,
|
||||
"collisionTolerance": 0,
|
||||
|
@ -10,7 +10,7 @@
|
|||
"bbox_left": 5,
|
||||
"bbox_right": 22,
|
||||
"bbox_top": 3,
|
||||
"bbox_bottom": 27,
|
||||
"bbox_bottom": 26,
|
||||
"HTile": false,
|
||||
"VTile": false,
|
||||
"For3D": false,
|
||||
|
@ -67,7 +67,7 @@
|
|||
"backdropXOffset": 0.0,
|
||||
"backdropYOffset": 0.0,
|
||||
"xorigin": 16,
|
||||
"yorigin": 26,
|
||||
"yorigin": 16,
|
||||
"eventToFunction": {},
|
||||
"eventStubScript": null,
|
||||
"parent": {"name":"s_momijiup","path":"sprites/s_momijiup/s_momijiup.yy",},
|
||||
|
|
Loading…
Reference in New Issue