Quote:
Originally Posted by Gunderak
And as for blocking tiles.
|
so you expect him to write down all blocking tiles while he could do a simple onwall(), onwall2() or tiletype() check?
Quote:
Originally Posted by Trakan
Thanks dude xD
Okay i now have:
PHP Code:
// Scripted by *Trakan //#CLIENTSIDE function onKeyPressed(keyCode, keyName, scanCode) { if (keyName == "e") { if (player.dir == 3 && !indodge) { freezeplayer(1.5); setani gh_gani_roulade, ; set indodge; for (temp.i = 0; temp.i < 4; temp.i++) { player.x += 1; sleep(.1); } sleep(0.5); unset indodge; setani idle, ; } if (player.dir == 1 && !indodge) { freezeplayer(1.5); setani gh_gani_roulade, ; set indodge; for (temp.i = 0; temp.i < 4; temp.i++) { player.x -= 1; sleep(.1); } sleep(0.5); unset indodge; setani idle, ; } if (player.dir == 0 && !indodge) { freezeplayer(1.5); setani gh_gani_roulade, ; set indodge; for (temp.i = 0; temp.i < 4; temp.i++) { player.y -= 1; sleep(.1); } sleep(0.5); unset indodge; setani idle, ; }
if (player.dir == 2 && !indodge) { freezeplayer(1.5); setani gh_gani_roulade, ; set indodge; for (temp.i = 0; temp.i < 4; temp.i++) { player.y += 1; sleep(.1); } sleep(0.5); unset indodge; setani idle, ; } } }
|
things you should fix:
PHP Code:
setani("ani", params); //proper gs2; if you dont have params make it NULL (params part)
this.indodge = boolean; //boolean is true or false; should be used instead of using (un)set
for (temp.i = 0; temp.i < 4; temp.i++) {
if (onwall2(player.x+0.5, player.y+1+1, 2, 2)) continue;
//onwall2(x, y, width, height);
//at the player.y part i added two +1 because the first is to have it go down to the "default" block check and the
//2nd one is for the new y position, personal reference of doing it like this; should be fixed with '-' or at the
//'player.x' parts when you are using it in other directions
//continue should make it leave the for() loop when you are on the wall (regarding the check)
player.y += 1;
sleep(.1);
}