K
Kaji_Ikaraseru
Guest
Ok so I am making top down tank game, and I made a nice (in my opinion) code for movement:
I am looking for a collision code (I don't know how to program so that all sides have perfect collision)
Any tips?
Code:
if keyboard_check((ord("D"))){
image_angle -= 4;
}
if keyboard_check((ord("A"))){
image_angle += 4;
}
if keyboard_check((ord("W"))){
if speed < 5 {
speed += 0.2;
}
direction = image_angle;
}
else{
if speed > 0 {
speed -= 0.1;
}
direction = image_angle;
}
if keyboard_check((ord("S"))){
if speed > -5 {
speed -= 0.2;
}
direction = image_angle;
}
else{
if speed < 0 {
speed += 0.1
}
direction = image_angle;
}
Any tips?