Hm well i just made it the child of oParEntity and the game opens now with out any errors YAY but i cant move? 1 thing to mention before i go on i had this code in the create event of oPlayer // Inherit oParEntity variables event_inherited();
I thought that would make it inherit oParEntity but i guess it doesn't. And im not sure why i cant move here is my code, this is in the step event (its to long for a picture) // Input //////////////////////////////////////////////////////////////////////
var kLeft, kRight, kUp, kDown, kJump, kJumpRelease, tempAccel, tempFric;
kLeft = keyboard_check(vk_left); kRight = keyboard_check(vk_right); kUp = keyboard_check(vk_up); kDown = keyboard_check(vk_down);
kJump = keyboard_check_pressed(ord('Z')); kJumpRelease = keyboard_check_released(ord('Z'));
// Movement ///////////////////////////////////////////////////////////////////
// Apply the correct form of acceleration and friction if (onGround()) {
tempAccel = groundAccel;
tempFric = groundFric;
} else { tempAccel = airAccel; tempFric = airFric; }
// Reset wall cling if ((!cRight && !cLeft) || onGround) { canStick = true; sticking = false; }
// Cling to wall
if (((kRight && cLeft) || (kLeft && cRight)) && canStick && !onGround) {
alarm[0] = clingTime;
sticking = true;
canStick = false;
}
// Handle gravity if (!onGround) { if ((cLeft || cRight) && vy >= 0) { // Wall slide vy = Approach(vy, vyMax, gravSlide); } else { // Fall normally vy = Approach(vy, vyMax, gravNorm); } }
// Left
if (kLeft && !kRight && !sticking) {
// Apply acceleration left
if (vx > 0)
vx = Approach(vx, 0, tempFric);
vx = Approach(vx, -vxMax, tempAccel);
}
// Right
if (kRight && !kLeft && !sticking) {
// Apply acceleration right
if (vx < 0)
vx = Approach(vx, 0, tempFric);
vx = Approach(vx, vxMax, tempAccel);
}
// Friction if (!kRight && !kLeft) vx = Approach(vx, 0, tempFric);
// Wall jump
if (kJump && cLeft && !onGround) {
if (kLeft) {
vy = -jumpHeight * 1.1;
vx = jumpHeight * .75;
} else {
vy = -jumpHeight * 1.1;
vx = vxMax;
}
}
if (kJump && cRight && !onGround) {
if (kRight) {
vy = -jumpHeight * 1.1;
vx = -jumpHeight * .75;
} else {
vy = -jumpHeight * 1.1;
vx = -vxMax;
}
}
// Jump if (kJump) { if (onGround) vy = -jumpHeight; // Variable jumping } else if (kJumpRelease) { if (vy < 0) vy *= 0.25; } and this is the code for the create event
// Inherit oParEntity variables event_inherited();
// Movement ///////////////////////////////////////////////////////////////////
// Multiplier m = 1.0;
groundAccel = 1.0 * m; groundFric = 1.9 * m; airAccel = 0.75 * m; airFric = 0.1 * m; vxMax = 6.5 * m; vyMax = 10.0 * m; jumpHeight = 8.0 * m; gravNorm = 0.5 * m; gravSlide = 0.25 * m;
clingTime = 4.0 * m;
// Misc ///////////////////////////////////////////////////////////////////////
// Relative collision checks cLeft = place_meeting(x - 1, y, oParSolid); cRight = place_meeting(x + 1, y, oParSolid);
// Common calculation sqrt2 = sqrt(2);
what am i doing wrong that is not making me able to move?