News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

Game Maker Super Metroid engine...

Started by :..:., April 22, 2013, 11:44:53 PM

Previous topic - Next topic

:..:.

http://www.mediafire.com/?j8sd0zx6sf5sy80

Crouching and standing animations added. If you jump into a tight space without morphball, does Samus just get stuck in crouching position in the original? Can someone check that out for me? There has to be a way out somehow.

personitis

Yes, she does become stuck. It's a bit of a common overlook in first time hacks. Though, it is possible turn and face the opposite direction and become un-stuck if you aren't too far into the gap.

Smiley

This just keeps getting better and better. Are we going to see morph ball or shooting soon?
And I see you based this off Martin Piecyk's platform engine. Good choice.

:..:.

#28
How did you know?


Also, tell me what you think about these smoother animations:







Also, morphball testing: http://www.mediafire.com/?j8sd0zx6sf5sy80

Has no bounce yet, which is weird since the code is there. No idea why it doesn't work. Try doing the mockball!

Smiley

Quote from: :..:. on May 04, 2013, 11:39:41 AM
How did you know?
F1 :wink:

The animations look really good and the morphball seems to work without problems.
At least I can't do the mockball, because
1. Samus' horizonal movement stops when morphing in mid-air
2. The down button has to be pressed 5-ish times to morph in mid-air anyway.

I have some Game Maker experience, so I could look into the code for you to find the error. Don't go counting on it though.

:..:.

You have to hold the jump button to mockball, and reach maximum dash speed. The pressing down thing is just the timer being too little, so you have to press the key really fast. I'll set it to 16 instead of 10.


Step event:

StatePrevious = State;

StateTime +=1 ;


//MASKS

setCollisionBounds(-6,-40,6,0); //ltrb
mask_index = sMask

if (State = JUMPING or State = CROUCHING)
{
setCollisionBounds(-6,-28,6,0); //ltrb
mask_index = sMask2
}

if (State = BALL or State = SPIDERBALL)
{
setCollisionBounds(-6,-12,6,0); //ltrb
mask_index = sMask3
}

sprite_control();

take_controls();

ON_GROUND_PREV = Flag[ON_GROUND];

Flag[ON_GROUND] = (isCollisionBottom(1) or (isCollisionPlatformBottom(1) && !isCollisionPlatform()));


// SLOPES

Physics[NOWATER,MAX_SLOPE] = abs(xVel) + 3;



if ON_GROUND_PREV = 0 && Flag[ON_GROUND] = 1
{
  // BOUNCE

if (State = BALL && !Morphing)
{
  if yVel > 3
  yVel = -2;
}


if AimDirection = 4 or AimDirection = 0 && !(kLeft or kRight) && !(State = BALL && Morphing)
{
  Flag[LANDING] = 7;
  if AimDirection = 0
   AimDirection = 4;
}
else
if !(State = BALL && Morphing)
   Flag[LANDING] = 2;

if Flag[TURNING] = 0 && Morphing = 0 && Demorphing = 0 && Flag[LANDING] = 0 && State != BALL
image_index = 0;

if State = JUMPING or (State = BALL && !Morphing)
xVel = 0;
}

if !Flag[ON_GROUND]
yVel += Physics[NOWATER,GRAVITY];
else
yVel = 0;

// MAX SPEEDS AND LIMITS

Physics[NOWATER,XVELLIMIT] = (3 - (!Flag[ON_GROUND]) * 1.5) - 0.15 + Dash;

if xVel>Physics[InWater,XVELLIMIT]
  xVel = Physics[InWater,XVELLIMIT];
else if xVel<-1*Physics[InWater,XVELLIMIT]
  xVel =- 1*Physics[InWater,XVELLIMIT];
if yVel>Physics[InWater,YVELLIMIT]
  yVel = Physics[InWater,YVELLIMIT];
else if yVel<-1*Physics[InWater,YVELLIMIT]
  yVel =- 1*Physics[InWater,YVELLIMIT];
 
//LANDING

if State = JUMPING && Flag[ON_GROUND]
State = STANDING;

if State != JUMPING
{
Aiming[JUMPING] = 0;
Flag[SPINNING] = 0;
}
 
// JUMPING

if State != JUMPING
Flag[FALLING] = 1;

if Flag[ON_GROUND] && (kJump && kJumpPushed < 2) && (State = STANDING or State = CROUCHING or State = RUNNING)  && !isCollisionTop(8)
{
if State = RUNNING
Flag[SPINNING] = 1;

Flag[TURNING] = 0;
if Flag[SPINNING] = 0
Flag[STARTJUMP] = 2;
else
Flag[STARTJUMP] = 1;
}

Flag[STARTJUMP] = max(Flag[STARTJUMP] - 1, -1);

if Flag[STARTJUMP] = 0
{
Flag[FALLING]= 0;
Flag[STARTJUMP] =- 1;
yVel = Physics[InWater,JUMPSPEED];
if State = CROUCHING
yVel *= 1.1;
State = JUMPING;
image_index = 0;
}

if Flag[ON_GROUND] = 0 && Flag[WALLJUMP] > 1 && (kJump && kJumpPushed < 2) && State = JUMPING
{
Flag[FALLING] = 0;
Flag[JUSTWALL] = 12;
Flag[STARTJUMP] =- 1;
Flag[SPINNING] = 1;
yVel = Physics[InWater,JUMPSPEED] / 1.666;
State = JUMPING;
image_index = 0;
xVel = Facing;
Flag[WALLJUMPED] = 1;

Smoke = instance_create(x - Facing * 3,y-6,oFXAnim);
Smoke.image_speed = .25;
Smoke.vspeed = -1;
}

if State != JUMPING or Flag[SPINNING] = 0
Flag[WALLJUMPED] = 0;

y += 2;

if State = JUMPING && Flag[SPINNING] && Flag[JUSTWALL] < 8 && !isCollisionBottom(2) && !isCollisionBottom(7) && StateTime > 5
{
if isCollisionLeftWall(5) && Facing = RIGHT && kRight && !kLeft
{
  Flag[WALLJUMP] = min(Flag[WALLJUMP] + 1, 12);
}
else
if isCollisionRightWall(5) && Facing = LEFT && !kRight && kLeft
{
  Flag[WALLJUMP] = min(Flag[WALLJUMP] + 1, 12);
}
else
Flag[WALLJUMP] = 0;
}
else
Flag[WALLJUMP] = 0;

y -= 2;

if !kJump && yVel<0 && (State = JUMPING) yVel*=.25

if yVel < 0 && isCollisionTop(1)
yVel *= .26;

// STATE CHANGES

if State != SAVING && State != BALL && State != SPIDERBALL && State != SUPERJUMP && State != SJEND && State != SJSTART && State != GRABBED && State != IDLE
{
if State != CROUCHING
{
  if Flag[ON_GROUND] && xVel = 0 && yVel = 0 && !((kLeft or kRight && (kLeft && kRight)) && abs(xVel) > .05)
   State = STANDING
  if Flag[ON_GROUND] && xVel != 0 && yVel = 0
   State = RUNNING
}
if !Flag[ON_GROUND]
  State = JUMPING
}


if AimDirection != 4 && Flag[SPINNING] && !kJump
{
Flag[SPINNING] = 0;
}

if (State = CROUCHING or (State = JUMPING && kDownTimer > 0 && AimDirection != 8 && AimTarget != 8 && Flag[SPINNING] = 0)) && kDownPressed && !kUp && global.PowerUp[MORPHBALL] = 1
{
Morphing = 5;
State = BALL;
}

if Flag[ON_GROUND] && State = STANDING && kDownPressed && yVel = 0 && abs(xVel) < 2 && CrouchTransition = 0 && !kLeft && !kRight && !Flag[TURNING]
{
State = CROUCHING
CrouchTransition = 3;
xVel = 0;
}

if Flag[ON_GROUND] && State = CROUCHING && ((kUpPressed) or ((kLeftPushed > 8 or kRightPushed > 8))) && !isCollisionCrouch()
&& yVel = 0 && xVel = 0 && CrouchTransition = 0  && !Flag[TURNING] && !isCollisionTop(8) && Demorphing = 0 && StateTime > 10
{
State = STANDING
CrouchTransition = 3;
}

if isCollisionCrouch() && (State = STANDING or State = RUNNING) && Flag[ON_GROUND]
State = CROUCHING;

if !Flag[ON_GROUND] && State = CROUCHING
State = JUMPING;

if (State = BALL or State = SPIDERBALL) && kUpPressed && !kDown && !isCollisionTop(16)
{
Demorphing = 5;
State = CROUCHING;
if !Flag[ON_GROUND]
  State = JUMPING;
kLeftPushed = 0;
kRightPushed = 0;
}


// MOVEMENT

if State != SAVING && State != SUPERJUMP && State != SJEND && State != SJSTART && State != SPIDERBALL && State != GRABBED && State != IDLE
{
if kLeft && !kRight
  xVel -= Physics[InWater,ACCELERATION] * ((State = BALL) + 1);
if !kLeft && kRight
  xVel += Physics[InWater,ACCELERATION] * ((State = BALL) + 1);
}

if !Flag[SPINNING] && !(State = JUMPING && !Flag[SPINNING] && abs(xVel) > 1.5 && kJump)
{
if xVel > 0 && (!kRight or (kRight && kLeft)) xVel = max(xVel - Physics[InWater,DECELERATION],0);
if xVel < 0 && (!kLeft or (kRight && kLeft)) xVel = min(xVel + Physics[InWater,DECELERATION],0);
}

y -= Physics[InWater,MAX_SLOPE];

if !isCollisionTop(1)
{
if xVel < 0 && isCollisionLeft(max(abs(1),1))
  xVel = 0;
if xVel > 0 && isCollisionRight(max(abs(1),1))
  xVel = 0;
}

y += Physics[InWater,MAX_SLOPE];

if (State = JUMPING && Flag[SPINNING]) && Flag[WALLJUMPED] = 0
{
if xVel > -Physics[InWater,XVELLIMIT]/2 && Facing = LEFT
xVel -= .075;
if xVel < Physics[InWater,XVELLIMIT]/2 && Facing = RIGHT
xVel += .075;
}
else
if Flag[WALLJUMPED] = 1 && !(kLeft or kRight && !(kLeft && kRight)) && !kJump
{
if xVel < -Physics[InWater,XVELLIMIT]/2 && Facing = LEFT
xVel += .1;
if xVel > Physics[InWater,XVELLIMIT]/2 && Facing = RIGHT
xVel -= .1;
}


if Flag[WALLJUMP] > 0
yVel *= .96;

if State = CROUCHING
{
xVel = 0;
yVel = 0;
}

// FACING

if !Flag[TURNING] && State != SAVING && State != GRABBED && State != SUPERJUMP
&& State != SJSTART && State != SJEND && State != IDLE
{
if kLeft && !kRight && Facing = RIGHT
{
  if State != BALL && State != SPIDERBALL && !Flag[SPINNING]
  {
   Flag[TURNING] = 1;
   image_index = 0;
  }
  Facing = LEFT;
  Flag[LANDING] = 0;
  if Flag[SPINNING]
  {
   Flag[JUSTWALL] = 0;
   image_index = max(image_index,3)
  }
  Dash = 0;
}
if !kLeft && kRight && Facing != RIGHT
{
  if State != BALL && State != SPIDERBALL && !Flag[SPINNING]
  {
   Flag[TURNING] = 1;
   image_index = 0;
  }
  Facing = RIGHT;
  Flag[LANDING] = 0;
  if Flag[SPINNING]
  {
   Flag[JUSTWALL] = 0;
   image_index = max(image_index,3)
  }
  Dash = 0;
}
}

// AIMING

if State = STANDING or State = RUNNING or State = CROUCHING
{
AimTarget = 4;
if ((kUp && kRight) or kAim) && Facing = RIGHT AimTarget = 6;
else
if ((kUp && kLeft) or kAim) && Facing = LEFT AimTarget = 6;
else
if (kUp && !kDown) && !kAim && !kAimDown && State != CROUCHING && CrouchTransition = 0 AimTarget = 8;
else
if ((kDown && kRight)or kAimDown) && Facing = RIGHT AimTarget = 2;
else
if ((kDown && kLeft)or kAimDown) && Facing = LEFT AimTarget = 2;

if kAimDown && kAim AimTarget = 8;
}

if State = JUMPING
{
if AimTarget != 0
AimTarget = 4;
if AimTarget = 0 && kLeft or kRight && !kUp && !kDown && !(kLeft && kRight)
AimTarget = 4;
if ((kUp && kRight) or kAim) && Facing = RIGHT AimTarget = 6;
else
if ((kUp && kLeft) or kAim) && Facing = LEFT AimTarget = 6;
else
if (kUp && !kDown) && !kAim && !kAimDown AimTarget = 8;
else
if ((kDown && kRight)or kAimDown) && Facing = RIGHT AimTarget = 2;
else
if ((kDown && kLeft)or kAimDown) && Facing = LEFT AimTarget = 2;
else
if kDown && !kUp AimTarget = 0;

if kAimDown && kAim AimTarget = 8;

if kDownPressed && Flag[SPINNING] && !kUp && !kLeft && !kRight
Flag[SPINNING] = 0;
}

if AimDirection > AimTarget AimDirection -= 2;
if AimDirection < AimTarget AimDirection += 2;


if yVel != 0 or Flag[ON_GROUND] = 0
Physics[NOWATER,MAX_SLOPE] = 1;

// DASHING

if Flag[LANDING] > 0
Dash = 0;

if kDash && State = RUNNING && abs(xVel) > 2.5
Dash = min(Dash + DashIncrement, DashMax);

if State = STANDING or abs(xVel) < 2.5
Dash = 0;



slope_control();



// TIMERS

Flag[LANDING] = max(Flag[LANDING] - 1, 0);
Flag[JUSTWALL] = max(Flag[JUSTWALL] - 1, 0);

kDownTimer = max(kDownTimer - 1,0);
CrouchTransition = max(CrouchTransition - 1,0);
Morphing = max(Morphing - 1,0);
Demorphing = max(Demorphing - 1,0);

if kDownPressed kDownTimer = MorphTime;

if State != StatePrevious
StateTime = 0;




Create:

Physics[NOWATER,MAX_SLOPE] = 4;
Physics[NOWATER,GRAVITY] = .135;
Physics[NOWATER,JUMPSPEED] = -8;
Physics[NOWATER,XVELLIMIT] = 3;
Physics[NOWATER,YVELLIMIT] = 5;
Physics[NOWATER,ACCELERATION] = .145;
Physics[NOWATER,DECELERATION] = .525;

InWater = 0;

StateTime = 0;

MorphTime = 16;

Flag[ON_GROUND] = 1;
Flag[SPINNING] = 0;
Flag[MORPHING] = 0;
Flag[UNMORPHING] = 0;
Flag[TURNING] = 0;
Flag[LANDING] = 0;
Flag[FALLING] = 1;
Flag[STARTJUMP] = 0;
Flag[WALLJUMP] = 0;
Flag[JUSTWALL] = 0;
Flag[WALLJUMPED] = 0;

Dash = 0;
DashMax = 1.5;
DashIncrement = .05;

Aiming[JUMPING] = 0;
Aiming[RUNNING] = 0;

State = STANDING; 
StatePrevious = STANDING;

AimDirection = 4;
AimTarget = 4;
AimFocus = 0;

JumpTransition = 0;
CrouchTransition = 0;
Morphing = 0;
Demorphing = 0;

FallAnim = 0;

TorsoSprite = sSStandAimRight;
TorsoIndex = 4;
TorsoX = 6;
TorsoY = -27;

sprite_index = sSStand;
image_index = 0;
image_speed = 0;

Facing = RIGHT;

activate();

kDownTimer = 0;

setCollisionBounds(-7,-40,7,0);



Go nuts.

:..:.

Don't nag me about double posts, this is my thread and I does what I wanna does.

So, important question. How should I implement moonwalking? If I bind yet another key to yet another functionality, I'm afraid that things will get too confusing in terms of control. I'm here to ask you hardcore Super Metroid fans how you'd like to control your moonwalks without adding 50 different keys.

MetroidMst

I don't moonwalk. I always leave it disabled. Always.

Vismund Cygnus

Quote from: MetroidMst on May 05, 2013, 03:11:33 AM
I don't moonwalk. I always leave it disabled. Always.
This is how I feel about it too.
However if you reeeeeeaaaaaaally want to implement it, firstly I'd recommend making a toggle for it.
Secondly, why not just use the same controls as what are used in the actual game?

:..:.

#34
What do you mean by 'toggle'? I don't think that will be comfortable to move around with if you accidentally leave it on and try to turn around.

Also, if you can guess from what this is based on:

Bonus points to you.

Vismund Cygnus

I mean as in the same as it is in the game. You can choose whether it's enabled or disabled.

:..:.

#36
Anybody out there a good sprite artist? I could really use some help with the aiming transitions.


Quietus

Adding my count to the exclusion of Moonwalk.  I've never used it, and I've never seen anybody else play with it enabled.

:..:.

 :awesome:   :yaynoes: :shocking: :omnom: :huzzah: :huzzah: :awesome: :flap: :flap: :drunken: :cheers: :cheers: :cheers: :cheers: :cheers: :drunken: :drunken: :drunken: :drunken: :glomp: :glomp: :glomp: :glomp: :glomp: :glomp: :glomp: :rfk:

http://www.mediafire.com/?j8sd0zx6sf5sy80

Smiley

So you got the bouncing to work. Great!
By the way, you may want to check your collisions:
bug 2
Nothing serious, but everything else so far is really smooth.


passarbye

Why would you post a video on youtube stating that your newest demo is an early alpha of Metroid SR388?  :stern:

[spoiler]http://www.youtube.com/watch?v=HkmzX8JVI3s[/spoiler]

Zhs2

#42
Probably because he knows it's dead and this is his idea of a joke for naming videos. If he posts another one with the name of a dead project, I'd laugh.

Only objection to this is that there sure are a lot of these videos where you do mostly the same exact thing in each one. I think your engine speaks for itself!

EDIT: Now a few hours later, I'm also told that the description for the video is likely a hoax as well (serves me right not viewing it in its native Youtube environment.) Doesn't make me think it's any less funny, just that it's rather obscure for humor and also somewhat of a jerk move.

:..:.

#43
Just decided to revert a few animation changes and did a few other unnoticeable things. Feel free to re-download if you give two craps.

http://www.mediafire.com/?j8sd0zx6sf5sy80

Moonwalk animation is in the code, but you can't execute it yet. Keep an eye out for that update, I've figured that I'll have it binded to the run key.
After that, I'll start work on the water physics and effects. Anything to delay shooting.

:..:.

#44
http://www.mediafire.com/?jw5j8j1bri8oh65

Moonwalk now functional, hold the run key and go the other way. Also water physics (which you can't test cuz' the water is too low! Suckers!) and morphball bouncing which I FINALLY fixed. Turns out the slope code worked even if your yVel wasn't equal to 0 whilst on the ground, and it kept pulling me down as I moved.

Quietus

Are you saying that if you are facing left, then you hold run and press right, you'll moonwalk?  If so, that's a bad choice.  Most Super Metroid players hold the run button nearly all the time, so there will be lots of instances of accidently moonwalking when all you want to do is turn round.

:..:.

I made it so that if you are already in motion and press to go the other way, you won't moonwalk. You have to be standing for it to work.

Mon732

Quote from: :..:. on May 10, 2013, 08:59:17 AM
I made it so that if you are already in motion and press to go the other way, you won't moonwalk. You have to be standing for it to work.

I believe that's how moonwalk works in super metroid except that needs the fire button to be held.
I recommend at somepoint having an option to turn off moonwalk entirely as I know I certainly hold the run button even if I'm not moving and having to either let go of the run button or move forward before turning might make it slightly harder to avoid enemies if you are stationary.

Decayed


:..:.

Like hell I'm spriting that.

If some guy from SR388 just dropped by and gave the graphics to me, sure, I'd be more than pleased to add in pushing to the game, but damn. I can't sprite.