Compare commits

..

2 commits

Author SHA1 Message Date
John Alanbrook 32484ac4a0 If command not found, play game 2024-04-26 17:06:43 -05:00
John Alanbrook 5da74796d5 Remove sgscale references 2024-04-22 08:47:04 -05:00
3 changed files with 3 additions and 10 deletions

View file

@ -162,7 +162,7 @@ Object.mixin(os.sprite(true), {
pick() { return this; }, pick() { return this; },
boundingbox() { boundingbox() {
var dim = this.dimensions(); var dim = this.dimensions();
dim = dim.scale(this.gameobject.gscale()); dim = dim.scale(this.gameobject.scale);
var realpos = dim.scale(0.5).add(this.pos); var realpos = dim.scale(0.5).add(this.pos);
return bbox.fromcwh(realpos,dim); return bbox.fromcwh(realpos,dim);
}, },

View file

@ -455,8 +455,8 @@ function cmd_args(cmdargs)
if (cmds.length === 0) if (cmds.length === 0)
cmds[0] = "play"; cmds[0] = "play";
else if (!Cmdline.orders[cmds[0]]) { else if (!Cmdline.orders[cmds[0]]) {
console.warn(`Command ${cmds[0]} not found.`); cmds[0] = "play";
return; console.warn(`Command ${cmds[0]} not found. Playing instead.`);
} }
Cmdline.orders[cmds[0]](cmds.slice(1)); Cmdline.orders[cmds[0]](cmds.slice(1));

View file

@ -928,12 +928,6 @@ static const JSCFunctionListEntry js_debug_funcs[] = {
CGETSET_ADD(global, static_color), CGETSET_ADD(global, static_color),
}; };
JSC_CCALL(physics_sgscale,
js2gameobject(argv[0])->scale.xy = js2vec2(argv[1]);
gameobject_apply(js2gameobject(argv[0]));
cpSpaceReindexShapesForBody(space, js2gameobject(argv[0])->body);
)
JSC_CCALL(physics_closest_point, JSC_CCALL(physics_closest_point,
void *v1 = js2cpvec2arr(argv[1]); void *v1 = js2cpvec2arr(argv[1]);
JSValue ret = number2js(point2segindex(js2vec2(argv[0]), v1, js2number(argv[2]))); JSValue ret = number2js(point2segindex(js2vec2(argv[0]), v1, js2number(argv[2])));
@ -1021,7 +1015,6 @@ JSC_CCALL(physics_point_query_nearest,
) )
static const JSCFunctionListEntry js_physics_funcs[] = { static const JSCFunctionListEntry js_physics_funcs[] = {
MIST_FUNC_DEF(physics, sgscale, 2),
MIST_FUNC_DEF(physics, point_query, 3), MIST_FUNC_DEF(physics, point_query, 3),
MIST_FUNC_DEF(physics, point_query_nearest, 2), MIST_FUNC_DEF(physics, point_query_nearest, 2),
MIST_FUNC_DEF(physics, ray_query, 4), MIST_FUNC_DEF(physics, ray_query, 4),