Smidy3
Member
Hey Everyone
New here to the world of gml and gamemaker.
Im making a top down sci fi shooter;
The players ship (Proto1) accelerates forward with "W" and reverses with "S"
"A" & "D" rotate the ship.
and i want "Q" & "E" to strafe left and right, but for the love of me i cannot seem to get it work, i think im just burnt out/overthinking it. And i just need a second pair of eyes.
Values
maxspeed = 5
reversespeed = 3
strafe_speed = 3
minmaxturn = 3
Please help me
New here to the world of gml and gamemaker.
Im making a top down sci fi shooter;
The players ship (Proto1) accelerates forward with "W" and reverses with "S"
"A" & "D" rotate the ship.
and i want "Q" & "E" to strafe left and right, but for the love of me i cannot seem to get it work, i think im just burnt out/overthinking it. And i just need a second pair of eyes.
Values
maxspeed = 5
reversespeed = 3
strafe_speed = 3
minmaxturn = 3
GML:
direction = image_angle;
//forward
if (keyboard_check(ord("W")))
{
if (speed < proto1.maxspeed)
{
speed += 0.1;
friction = 0;
}
}
else {
if !(keyboard_check(ord("S")))
if !(keyboard_check(ord("Q")))
if !(keyboard_check(ord("E")))
{
if (speed > 0)
{
friction = 0.1;
}
}
}
//backward
if (keyboard_check(ord("S")))
{
if (speed > -proto1.reversespeed)
{
speed -= 0.1;
friction = 0;
}
}
else {
if !(keyboard_check(ord("W")))
if !(keyboard_check(ord("Q")))
if !(keyboard_check(ord("E")))
{
if (speed < 0)
{
friction = 0.1;
}
}
}
//strafe left
if (keyboard_check(ord("Q")))
{
{
if (keyboard_check_pressed ("Q"))
direction -= 90;
}
if (speed < proto1.strafe_speed)
{
speed -= 0.1;
friction = 0;
}
}
else {
if !(keyboard_check(ord("S")))
if !(keyboard_check(ord("W")))
if !(keyboard_check(ord("E")))
{
if (speed > 0)
{
friction = 0.1;
}
}
}
//strafe right
if (keyboard_check(ord("E")))
{
{
if (keyboard_check_pressed ("E"))
direction += 90;
}
if (speed < proto1.strafe_speed)
{
speed -= 0.1;
friction = 0;
}
}
else {
if !(keyboard_check(ord("S")))
if !(keyboard_check(ord("W")))
if !(keyboard_check(ord("E")))
{
if (speed > 0)
{
friction = 0.1;
}
}
}
//rotate left
if (keyboard_check(ord("A")))
{
image_angle += proto1.minmaxturn
if image_angle > 360
image_angle = 0
}
//roate right
if (keyboard_check(ord("D")))
{
image_angle -= proto1.minmaxturn
if image_angle < 0
image_angle = 360
}
Please help me