Repix
Member
I've done this before.. like ages ago. But I forgot how I worked my way around this..
I know why it doesn't work, but I can't come up with a good work around other than putting in way too much unnecessary code. Any suggestions?
I know why it doesn't work, but I can't come up with a good work around other than putting in way too much unnecessary code. Any suggestions?
Code:
///angle system
var dd = angle_difference(image_angle, global.pd);
image_angle -= min(abs(dd), 10) * sign(dd);
//setting those variables to its keys
if keyboard_check(ord('D'))
{
global.pd = 360
}
else if keyboard_check(ord('W'))
{
global.pd = 90
}
else if keyboard_check(ord('A'))
{
global.pd = 180
}
else if keyboard_check(ord('S'))
{
global.pd = 270
}
else if keyboard_check(ord('S')) && keyboard_check(ord('W'))
{
global.pd = 315
}
else if keyboard_check(ord('W')) && keyboard_check(ord('D'))
{
global.pd = 45
}
else if keyboard_check(ord('D')) && keyboard_check(ord('S'))
{
global.pd = 135
}
else if keyboard_check(ord('S')) && keyboard_check(ord('A'))
{
global.pd = 225
}