Drafted use of gravity.

This commit is contained in:
genxium
2022-12-09 17:22:04 +08:00
parent dc66be1599
commit 62e50f8b6c
8 changed files with 744 additions and 344 deletions

View File

@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.2" tiledversion="1.2.3" orientation="orthogonal" renderorder="right-down" width="128" height="128" tilewidth="16" tileheight="16" infinite="0" nextlayerid="3" nextobjectid="39">
<map version="1.2" tiledversion="1.2.3" orientation="orthogonal" renderorder="right-down" width="128" height="128" tilewidth="16" tileheight="16" infinite="0" nextlayerid="3" nextobjectid="49">
<tileset firstgid="1" source="tiles0.tsx"/>
<tileset firstgid="65" source="tiles1.tsx"/>
<tileset firstgid="129" source="tiles2.tsx"/>
<layer id="2" name="Ground" width="128" height="128">
<data encoding="base64" compression="zlib">
eJzt2q1u22AYhuEo1UhBtYFWKh/bmRRMRYNFPZPxwcKi7jznSInkWk7teG5ex88FLhQD570d5/PP1WazuQIAAAAAAAAAAAAAAAAAgAmu96r3g/N5bjn0fw5U3aGy/3bv0P+p8XDEdoX0f9//GP3Xp93/YaD/9QJa6f95/fvov26773671zeb7jmhupX+5+2fQH/9qztU9v8yQXUz/fXXX3/9a/ovgf7666+//vrrf1n9/4zc7tue/uvq/9Z4PfLZ7vnz38ZP/cv7T53p4Z7i7/+kv/7667/bl/sO/dff/77T3+9ff/3r+38dMGf/Nv1r+w917+v/0vh1okN/67/l9B/b/nFj/X8pxvYf236r/0UZ6t/X+Efj5kj7bv+uxxPpX9e/r/1NS7f7Z/S/a3zXfzH9Pzrvt/vPTf/l9p+yRjyV/ufvP+YY6M5yzr5D5uy/XUCLJfafa8YfmdJe//X0r6Z/9jGgv/7661/doqp/9fyrpV//Vc+/mv7Z9M+mfzb9s+mfTf9s+mfTP5v+2fTPpn82/bPpn03/bPpn0z+b/tn0z6Z/Nv2z6Z/N+9/Z9M+mfzb//9n0z6Z/Nv2z6Z9N/2z6Z9M/m/7Z0vtT3wEAAAAAAAAAAAAAAAA4v39IY4NC
eJzt2qFu21AUgOEo1UhBtYJOKh/bmxRMRYNFfZPxwcGi7j3nSInkXTmx47k+1/d84EOJIuf+PtZ14pvdbncDAAAAAAAAAAAAAAAAAAAz3B5FHwfree059X9NKLpDZP/90an/S+fpjH2D9P+3/zn6t6ff/2mk/20FrfT/uP5D9G/b4bs/HA2tTXlNiG6l/7r9M9Bf/+gOkf0/zRDdTH/99ddf/5j+NdBff/31119//bfV/9fE990f6d9W//fO25nXDv8//+l81z+8/9w1Pf2m+PM/6a+//vofjuWxoH/7/R+L/uZff/3j+38esWT/Pv1j+491H+r/u/PjSqf+9n/19J/a/nln/78VU/tPbb/Xf1PG+g81/ta5O9O+7F96vpL+cf2H2t/1lN0/ov+Xzlf9q+l/6brf7780/evtP2ePeC391+8/5Rwo13LJvmOW7L+voEWN/Zda40vmtNe/nf7R9M99Duivv/76R7eI6h+9/tGy3/9Fr380/XPTPzf9c9M/N/1z0z83/XPTPzf9c9M/N/1z0z83/XPTPzf9c9N/vvtCdEv9t9e//IxL9G+vfzT9l5vV6Jb6rzv/LdB/XbVdOzz/Pb1V9Kzqv/35r43+80Xdsy3dP7rDVvu3QP/tzaz+5l//bfSvfU+g//r959B/vf5b3s/rX9f8107/3PTPLXt/4jsAAAAAAAAAAAAAAAAA6/sLjbyILg==
</data>
</layer>
<objectgroup id="1" name="PlayerStartingPos">
<object id="135" x="1090" y="833.667">
<object id="135" x="980" y="1588.67">
<point/>
</object>
<object id="137" x="1215" y="830.5">
<object id="137" x="1349" y="1580.5">
<point/>
</object>
</objectgroup>
@@ -164,5 +164,65 @@
</properties>
<polyline points="0,0 0,46.3333 47,46.3333 47,-1"/>
</object>
<object id="39" x="960" y="1327">
<properties>
<property name="boundary_type" value="barrier"/>
</properties>
<polyline points="0,0 -65,0 -64,58 -2,61"/>
</object>
<object id="40" x="735" y="1486">
<properties>
<property name="boundary_type" value="barrier"/>
</properties>
<polyline points="0,0 -63,1 -62,14 0,16 1,16 0,14"/>
</object>
<object id="41" x="832" y="1375.33">
<properties>
<property name="boundary_type" value="barrier"/>
</properties>
<polyline points="0,0 -0.666667,15.3333 128.667,15.3333 130,0"/>
</object>
<object id="42" x="832.667" y="1424">
<properties>
<property name="boundary_type" value="barrier"/>
</properties>
<polyline points="0,0 -66,0 -65.3333,15.3333 2,16"/>
</object>
<object id="43" x="850" y="1552.67">
<properties>
<property name="boundary_type" value="barrier"/>
</properties>
<polyline points="0,0 -115.333,0 -116,14 -0.666667,14.6667"/>
</object>
<object id="44" x="1042" y="1454.67">
<properties>
<property name="boundary_type" value="barrier"/>
</properties>
<polyline points="0,0 -148.667,0.666667 -148.667,15.3333 0,16.6667"/>
</object>
<object id="45" x="1345.33" y="1343.33">
<properties>
<property name="boundary_type" value="barrier"/>
</properties>
<polyline points="0,0 -178,0 -178,14 -0.666667,15.3333"/>
</object>
<object id="46" x="1200" y="1406.67">
<properties>
<property name="boundary_type" value="barrier"/>
</properties>
<polyline points="0,0 -96.6667,0 -96.6667,15.3333 0,16.6667"/>
</object>
<object id="47" x="1120" y="1520.67">
<properties>
<property name="boundary_type" value="barrier"/>
</properties>
<polyline points="0,0 -80,-0.666667 -80,30 0,31.3333"/>
</object>
<object id="48" x="1116" y="1536.67">
<properties>
<property name="boundary_type" value="barrier"/>
</properties>
<polyline points="0,0 -4.66667,12.6667 213.333,14.6667 212.667,-2"/>
</object>
</objectgroup>
</map>

View File

@@ -9,22 +9,25 @@ message PlayerDownsync {
int32 virtualGridX = 2;
int32 virtualGridY = 3;
int32 dirX = 4;
int32 dirY = 5;
int32 speed = 6; // in terms of virtual grid units
int32 battleState = 7;
int32 joinIndex = 8;
double colliderRadius = 9;
bool removed = 10;
int32 score = 11;
int32 lastMoveGmtMillis = 12;
int32 framesToRecover = 13;
int32 hp = 14;
int32 maxHp = 15;
int32 characterState = 16;
int32 dirY = 5; // "dirX" and "dirY" determines character facing
int32 velX = 6;
int32 velY = 7; // "velX" and "velY" is used to record the accumulated effect by accelerations (including gravity)
int32 speed = 8; // this is the instantaneous scalar attribute of a character, different from but will be accounted in "velX" and "velY"
int32 battleState = 9;
int32 joinIndex = 10;
double colliderRadius = 11;
bool removed = 12;
int32 score = 13;
int32 lastMoveGmtMillis = 14;
int32 framesToRecover = 15;
int32 hp = 16;
int32 maxHp = 17;
int32 characterState = 18;
bool inAir = 19; // by design a standalone field only inferred by the collision result of "applyInputFrameDownsyncDynamicsOnSingleRenderFrame" instead of "characterState", because we need check the transition for "characterState" from this field, i.e. "inAir (prev -> curr)"
string name = 17;
string displayName = 18;
string avatar = 19;
string name = 20;
string displayName = 21;
string avatar = 22;
}
message InputFrameDecoded {