@@ -694,9 +694,9 @@ var Sprite = /* module */[
694694] ;
695695
696696function pair_to_xy ( pair ) {
697- return /* array */ [
698- pair [ 0 ] ,
699- pair [ 1 ]
697+ return /* record */ [
698+ /* x */ pair [ 0 ] ,
699+ /* y */ pair [ 1 ]
700700 ] ;
701701}
702702
@@ -850,13 +850,13 @@ function make$2($staropt$star, $staropt$star$1, spawnable, context, param) {
850850 var id$1 = id ? id [ 0 ] : new_id ( /* () */ 0 ) ;
851851 var obj = /* record */ [
852852 /* params */ params ,
853- /* pos : array */ [
854- param [ 0 ] ,
855- param [ 1 ]
853+ /* pos : record */ [
854+ /* x */ param [ 0 ] ,
855+ /* y */ param [ 1 ]
856856 ] ,
857- /* vel : array */ [
858- 0.0 ,
859- 0.0
857+ /* vel : record */ [
858+ /* x */ 0.0 ,
859+ /* y */ 0.0
860860 ] ,
861861 /* id */ id$1 ,
862862 /* jumping */ false ,
@@ -1221,13 +1221,13 @@ function get_aabb(obj) {
12211221 var sy = match$1 [ 1 ] ;
12221222 var sx = match$1 [ 0 ] ;
12231223 return /* record */ [
1224- /* center : array */ [
1225- box + sx / 2 ,
1226- boy + sy / 2
1224+ /* center : record */ [
1225+ /* x */ box + sx / 2 ,
1226+ /* y */ boy + sy / 2
12271227 ] ,
1228- /* half : array */ [
1229- sx / 2 ,
1230- sy / 2
1228+ /* half : record */ [
1229+ /* x */ sx / 2 ,
1230+ /* y */ sy / 2
12311231 ]
12321232 ] ;
12331233}
@@ -1512,17 +1512,17 @@ var Draw = /* module */[
15121512
15131513function make$3 ( param , param$1 ) {
15141514 return /* record */ [
1515- /* pos : array */ [
1516- 0 ,
1517- 0
1515+ /* pos : record */ [
1516+ /* x */ 0 ,
1517+ /* y */ 0
15181518 ] ,
1519- /* v_dim : array */ [
1520- param [ 0 ] ,
1521- param [ 1 ]
1519+ /* v_dim : record */ [
1520+ /* x */ param [ 0 ] ,
1521+ /* y */ param [ 1 ]
15221522 ] ,
1523- /* m_dim : array */ [
1524- param$1 [ 0 ] ,
1525- param$1 [ 1 ]
1523+ /* m_dim : record */ [
1524+ /* x */ param$1 [ 0 ] ,
1525+ /* y */ param$1 [ 1 ]
15261526 ]
15271527 ] ;
15281528}
@@ -1552,18 +1552,18 @@ function out_of_viewport_below(v, y) {
15521552}
15531553
15541554function coord_to_viewport ( viewport , coord ) {
1555- return /* array */ [
1556- coord [ /* x */ 0 ] - viewport [ /* pos */ 0 ] [ /* x */ 0 ] ,
1557- coord [ /* y */ 1 ] - viewport [ /* pos */ 0 ] [ /* y */ 1 ]
1555+ return /* record */ [
1556+ /* x */ coord [ /* x */ 0 ] - viewport [ /* pos */ 0 ] [ /* x */ 0 ] ,
1557+ /* y */ coord [ /* y */ 1 ] - viewport [ /* pos */ 0 ] [ /* y */ 1 ]
15581558 ] ;
15591559}
15601560
15611561function update ( vpt , ctr ) {
15621562 var new_x = calc_viewport_point ( ctr [ /* x */ 0 ] , vpt [ /* v_dim */ 1 ] [ /* x */ 0 ] , vpt [ /* m_dim */ 2 ] [ /* x */ 0 ] ) ;
15631563 var new_y = calc_viewport_point ( ctr [ /* y */ 1 ] , vpt [ /* v_dim */ 1 ] [ /* y */ 1 ] , vpt [ /* m_dim */ 2 ] [ /* y */ 1 ] ) ;
1564- var pos = /* array */ [
1565- new_x ,
1566- new_y
1564+ var pos = /* record */ [
1565+ /* x */ new_x ,
1566+ /* y */ new_y
15671567 ] ;
15681568 return /* record */ [
15691569 /* pos */ pos ,
@@ -2234,18 +2234,26 @@ function update_loop(canvas, param, map_dim) {
22342234 if ( player$1 [ 2 ] [ /* kill */ 8 ] === true ) {
22352235 return game_loss ( state [ /* ctx */ 1 ] ) ;
22362236 } else {
2237- var newrecord = state . slice ( ) ;
2238- newrecord [ /* vpt */ 2 ] = update ( state [ /* vpt */ 2 ] , player$1 [ 2 ] [ /* pos */ 1 ] ) ;
2237+ var state$1 = /* record */ [
2238+ /* bgd */ state [ /* bgd */ 0 ] ,
2239+ /* ctx */ state [ /* ctx */ 1 ] ,
2240+ /* vpt */ update ( state [ /* vpt */ 2 ] , player$1 [ 2 ] [ /* pos */ 1 ] ) ,
2241+ /* map */ state [ /* map */ 3 ] ,
2242+ /* score */ state [ /* score */ 4 ] ,
2243+ /* coins */ state [ /* coins */ 5 ] ,
2244+ /* multiplier */ state [ /* multiplier */ 6 ] ,
2245+ /* game_over */ state [ /* game_over */ 7 ]
2246+ ] ;
22392247 List . iter ( ( function ( obj ) {
2240- run_update_collid ( newrecord , obj , objs ) ;
2248+ run_update_collid ( state$1 , obj , objs ) ;
22412249 return /* () */ 0 ;
22422250 } ) , objs ) ;
22432251 List . iter ( ( function ( part ) {
2244- var state = newrecord ;
2252+ var state$2 = state$1 ;
22452253 var part$1 = part ;
22462254 $$process ( part$1 ) ;
2247- var x = part$1 [ /* pos */ 2 ] [ /* x */ 0 ] - state [ /* vpt */ 2 ] [ /* pos */ 0 ] [ /* x */ 0 ] ;
2248- var y = part$1 [ /* pos */ 2 ] [ /* y */ 1 ] - state [ /* vpt */ 2 ] [ /* pos */ 0 ] [ /* y */ 1 ] ;
2255+ var x = part$1 [ /* pos */ 2 ] [ /* x */ 0 ] - state$2 [ /* vpt */ 2 ] [ /* pos */ 0 ] [ /* x */ 0 ] ;
2256+ var y = part$1 [ /* pos */ 2 ] [ /* y */ 1 ] - state$2 [ /* vpt */ 2 ] [ /* pos */ 0 ] [ /* y */ 1 ] ;
22492257 render ( part$1 [ /* params */ 0 ] [ /* sprite */ 0 ] , /* tuple */ [
22502258 x ,
22512259 y
@@ -2261,9 +2269,9 @@ function update_loop(canvas, param, map_dim) {
22612269 }
22622270 } ) , parts ) ;
22632271 fps ( canvas , fps$1 ) ;
2264- hud ( canvas , newrecord [ /* score */ 4 ] , newrecord [ /* coins */ 5 ] ) ;
2272+ hud ( canvas , state$1 [ /* score */ 4 ] , state$1 [ /* coins */ 5 ] ) ;
22652273 requestAnimationFrame ( ( function ( t ) {
2266- return update_helper ( t , newrecord , player$1 , collid_objs [ 0 ] , particles [ 0 ] ) ;
2274+ return update_helper ( t , state$1 , player$1 , collid_objs [ 0 ] , particles [ 0 ] ) ;
22672275 } ) ) ;
22682276 return /* () */ 0 ;
22692277 }
0 commit comments