Hi there!
I'm currently working on a leveleditor for a Jump n' Run game.
Saving / Loading levels from text-files, deleting blocks, moving
the camera, ...
Everything works fine - but again I've got problems with the simplest part.
I want to move an entity with the W,S,A,D-keys in 4 directions (X+ / X- / Y+ / Y-).
The W-key (for example) should always move the entity away from the camera.
I'm using this at the moment:
move_vec.x = key_w - key_s;
move_vec.y = key_a - key_d;
vec_rotate(move_vec, vector( integer(camera.pan / 90 + 0.5) * 90, 0 , 0 ));
But it doesn't work correctly.
C = camera
A
C > S W
D
-------------------
W
A D
S
^
C