Posted: Tue Dec 07, 2021 3:09 pm Post subject: Air Break
So i'm making air break (game speed slows and adds an ability to control player's character or object,used looking coordinates for air break),i've already made a hotkeys that regulate height,but the problem is i can't do the side one
Code:
if isKeyPressed(VK_NUMPAD3) then
writeFloat(0xAAB144,readFloat(0xAAB144)-1) --Height coordinate(Y coord)
end
if isKeyPressed(VK_NUMPAD9) then
writeFloat(0xAAB144,readFloat(0xAAB144)+1) --Height coordinate(Y coord)
end
if isKeyPressed(VK_NUMPAD2) then
writeFloat(0xAAB140,readFloat(0xAAB140)-readFloat(0xAAB1C0)/2) --Move backwards (X and Z coords)
writeFloat(0xAAB148,readFloat(0xAAB148)-readFloat(0xAAB1C8)/2) --Move backward (X and Z coords)
end
if isKeyPressed(VK_NUMPAD8) then
writeFloat(0xAAB140,readFloat(0xAAB140)+readFloat(0xAAB1C0)/2) --Move forward (X and Z coords)
writeFloat(0xAAB148,readFloat(0xAAB148)+readFloat(0xAAB1C8)/2) --Move forward (X and Z coords)
end
if isKeyPressed(VK_NUMPAD4) then
writeFloat(0xAAB140,readFloat(0xAAB140)-readFloat(0xAAB1C0)*2) --Left
writeFloat(0xAAB148,readFloat(0xAAB148)-readFloat(0xAAB1C8)*2) --Left
end
if isKeyPressed(VK_NUMPAD6) then
writeFloat(0xAAB140,readFloat(0xAAB140)+readFloat(0xAAB1C0)*2) --Right
writeFloat(0xAAB148,readFloat(0xAAB148)+readFloat(0xAAB1C8)*2) --Right
end
You barely say what you want to do and give next to no information on what you've done so far.
You'll probably need to use basic trigonometry to figure out how much to add to x/y coordinates given the direction you're looking in. _________________
I don't know where I'm going, but I'll figure it out when I get there.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum