![]() |
How would you make onwall detection for this script?
if (created||timeout) { if (this.active==1) { //movement script if (keydown(0)) { playery-=0.5; playerdir = 0; } if (keydown(1)) { playerx-=0.5; playerdir = 1; } if (keydown(2)) { playery+=0.5; playerdir = 2; } if (keydown(3)) { playerx+=0.5; playerdir = 3; } setani fglev,l; disabledefmovement; } //Activating or deactivating script. if (keydown(4)) { if (this.pressed==0) { enabledefmovement; if (this.active==0) this.active=1; else this.active=0; this.pressed=1; this.pressed=1; } } else { this.pressed=0; } timeout = 0.05; } |
You could change your movement things so they look like this:
NPC Code: the playerx, and playery+1.5 are the co-ordinates where it looks to see if its onwall, do same for other directions, changing the co-ordinates of the onwall for each... or you can add something like this: NPC Code: this'll just bounce him back if in the wall, but youll have to have the original movement script as well. |
Thx
Thanks that worked!
ummmmmm... How would you make it do ollieskateboard.gani while on it like press S and it plays it and then goes back to skateboard.gani... fir the same script... When I tried it it froze me... |
I cant remember what keydown s is... maybe 5? If wrong just change it... also, for this to work you will have to have disabledefmovement on
NPC Code: There, thats a simple way, also if you wanted you could at params to the gani to make diffent style skateboards and colours... just a thought :) |
>=\\
You copied our skateboard !
|
Grey_Mage did? bad...
|
Stop stealing shadrock's gani's!
Only i can do that i mean ummm.....*runs away* |
Nah!
Nah I didn't steal your skateboard I am trying to make one from scratch!
|
| All times are GMT +2. The time now is 04:38 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.