![]() |
Gravity/Jump n Run
[ Delph Inc. ]
I have finished one of my little gravity/jump n run scripts...but I'm trying to make it so only one type of tile blocks you. I've added in all the board script so 4 types of wall tiles don't block you but it stuffed the whole thing up. Yes...you can now move up and down, left and right through these wall tiles...one thing though is that it doesn't let you go diagonal. Also, now when you press the jump button whilst on a texture of these 4 tiles you just go up and don't come down. And when you hold down you come down. It's very wierd and hard to explain. But I'm just wondering if anyone is out there who can speak my language and help me. Thanks |
well I can only under some of what your saying...
the keydown part... for that you have to do it in seperate if/thens... I beleve you have it like this right now Quote:
elseif all the time just use 4 if's like this Quote:
|
well if you use elseif
then your checking for 1 thing and if that thing is correct then it doesn't check for the rest... yea you can make it shorter by using vecx and y but I didn't think of that when I was typing it... |
What exactly is vecx and vecy? Perhaps I use a different term...
|
Quote:
if(keydown(blah)){ }elseif(keydown(blah)){ } ect like I think he did then the guy wont go diaganal like he was describing |
if hes not making it diagonal then use elseif's
if hes making diagonal you need if (else you are going to do dual if checkings for keys .. stupid would just increase ur onwall crap) also i never tried but if u wanna make 1 type of tile instead of using board use that new command in the new G2k1 2.1 the tiles(x,y) or something . I havent tested it but board is picky and needs whole numbers (no decimals) and tiles(x,y) might accept decimals (increasing the accuracy of your onwall) =) |
[ Delph Inc. ]
Board works fine and I can walk through only the 4 tiles I have specified but not Diagonal. I will try the keydown thing again...it didn't work before and I might try something like: if (keydown(playerdir)) { playerx+=vecx(playerx); playery+=vecy(playery); } That would work wouldn't it? Could you give me some more on this tile(x,y) thing? Or is it just like the 'in' command? Quote:
e.g. vecx contains this array {0,-1,0,1} and vecy contains {-1,0,1,0} So if you're using vecx and your NPC/player is facing left, you would get the result -1. |
Ohhhh..... Gotcha!
|
| All times are GMT +2. The time now is 08:28 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.