FlatulenzaFiamm
Member
Hey there comrades. Now that I got into GML coding it feels like I'm back to 2018 (spamming threads because I don't understand jacksh*t).
Anyway, got another thing for y'all:
So this is a basic code for movement and collision. What I don't get is why the collision does work for the "corp" object, but not for "anim" (which is the object in which this thing is written).
After all, they both take 'hsp_x' and 'hsp_y' as variable for movement. Yet, it does not work.
Even checking the 'hsp_x' and 'hsp_y' variables via a debugger they keep being 0 once they reach that point.
Can someone X-PLAIN this crap? Thanke, much love comrades.
Anyway, got another thing for y'all:
Code:
STEP EVENT - anim
sinistra = keyboard_check(ord("A"))
destra = keyboard_check(ord("D"))
su = keyboard_check(ord("W"))
giu = keyboard_check(ord("S"))
var mov1 = destra - sinistra
var mov2 = giu - su
hsp_x = mov1 * wlk_spd
hsp_y = mov2 * wlk_spd/2
x = x + hsp_x
y = y + hsp_y
if place_meeting (x+hsp_x,y,bar)
{
hsp_x = 0
}
if place_meeting (x,y+hsp_y,bar)
{
hsp_y = 0
}
with (corp)
{
x = x + anim.hsp_x
y = y + anim.hsp_y
}
After all, they both take 'hsp_x' and 'hsp_y' as variable for movement. Yet, it does not work.
Even checking the 'hsp_x' and 'hsp_y' variables via a debugger they keep being 0 once they reach that point.
Can someone X-PLAIN this crap? Thanke, much love comrades.
Last edited: