Another problem, ive been at this for about 2 hours now.
This is the code for the sprite to move, change animations an all that jazz, it worked until
I started adding in things for the collision.
The game starts and the guy is stood there doing nothing, but when you press the up key the animation to go whatever direction
your facing starts to play and he doesn't move , same with the left key. If I press the right key the game comes up with this error:
of Step Event
for object Object_Player:
Error in code at line 47:
if 'place_meeting(x-1,y,object_Wall)
^
at position 5: Expression expected
_____________________________ ______________
ERROR in
action number 1
of Step Event
for object Object_Player:
Error in code at line 47:
if 'place_meeting(x-1,y,object_Wall)
^
at position 5: Expression expected
If I press the down key I get this:
of Step Event
for object Object_Player:
Error in code at line 47:
if 'place_meeting(x-1,y,object_Wall)
^
at position 5: Expression expected
_____________________________ ______________
ERROR in
action number 1
of Step Event
for object Object_Player:
Error in code at line 8:
if 'place_meeting(x,y-1,object_Wall)
^
at position 9: Expression expected
This is the actual code:
if keyboard_check(vk_down)
{
sprite_index = Player_Down;
y += 3;
for(a = 1; a < 5; a += 1)
{
if 'place_meeting(x,y-1,object_Wall)
{
y += 1
}
}
}
if keyboard_check(vk_up)
{
sprite_index = Player_Up
y -= 3;
for(a = 1; a < 5; a += 1)
{
if 'place_meeting(x,y-1,object_Wall)
}
y -= 1
}
if keyboard_check(vk_right)
{
sprite_index = Player_Right
x += 3;
for(a = 1; a < 5; a += 1)
{
if 'place_meeting(x-1,y,object_Wall)
}
x -= 1
}
}
if keyboard_check(vk_left)
{
sprite_index = Player_Left
x -= 3;
for(a = 1; a < 5; a += 1)
{
if 'place_meeting(x+1,y,object_Wall)
}
y += 1
}
if keyboard_check(vk_down) or keyboard_check(vk_up) or keyboard_check(vk_right) or keyboard_check(vk_left)
{
image_speed = .3;
}
else
image_speed = 0;
I've tried re-writing things, removing stuff but nothings working and I don't want to have to type it out again, it wouldn't be so bad
if I knew which parts were messing up so I could copy and paste the good stuff but I haven't a clue whats going on, and this is my first time doing gml.