60 lines
1.4 KiB
Plaintext
60 lines
1.4 KiB
Plaintext
//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);
|
|
}*/
|
|
|
|
|
|
c_loadstageone();
|
|
|
|
selectedunit = noone;
|
|
hoveredunit = noone;
|
|
hspd = 0;
|
|
vspd = 0;
|
|
global.gw = 640;
|
|
global.gh = 360;
|
|
global.camerax = 0;
|
|
global.cameray = 0;
|
|
state = st_control;
|
|
cursor = new vec2(0, 0);
|
|
//these are functions bc c_2dto3d uses them
|
|
function getProj(){
|
|
return matrix_build_projection_perspective_fov(60,-16/9,1,4000)
|
|
}
|
|
function getView(){
|
|
var _x = global.camerax;
|
|
var _y = global.cameray;
|
|
var half = (7.5*32)+40;
|
|
return matrix_build_lookat(_x,_y+60,90,_x,_y,0,0,0,-1);
|
|
}
|
|
|
|
function setCam(){
|
|
var cam = camera_get_active();
|
|
camera_set_proj_mat(cam,getProj());
|
|
camera_set_view_mat(cam,getView())
|
|
camera_apply(cam);
|
|
}
|
|
global.turn = ARMY.US;
|
|
|
|
function drawModels(){
|
|
//gpu_set_cullmode(cull_counterclockwise);
|
|
gpu_set_ztestenable(true);
|
|
gpu_set_alphatestenable(true);
|
|
gpu_set_alphatestref(128);
|
|
for(var i = 0; i < array_length(models);i++){
|
|
models[i].draw();
|
|
}
|
|
gpu_set_alphatestenable(false);
|
|
gpu_set_cullmode(cull_noculling);
|
|
gpu_set_ztestenable(false);
|
|
}
|
|
|
|
models = [];
|
|
|
|
//var spr = sprite_add("./shrine thing tex.png",0,false,false,0,0);
|
|
|
|
textbox_create(txt_test);
|
|
var spr = sprite_add("./map1/mapatlas.png",0,false,false,0,0);
|
|
nu Model("./map1/map1.dat", spr, u, 200, 140, u, 4, u, u, u,);
|
|
setCam(); |