Late response with a bigass bump, but I recommend stepping your toes in Flash and Actionscript before ever taking a cannonball into the code itself. I've decompiled it, for education's sake, and trust me when I say it is big as hell. Also difficult to translate, since it was programmed at an earlier age in Rob's lifetime, meaning it is unorganized. Last Legacy, on the other hand, uses a more fluid class approach where the game calls on each class file in the obfuscated compiled edition. This wasn't the case with Super Mairo 63. At all.
My recommendation is that if you have Flash, start with the basics. Learn to work with layers, learn to work with tweens and frames. Learn symbols. Learn everything at the roots. From then on, play with things. Practice. Study the code. Code your own scripts and run them. Play with open-source projects, learn how they work.
I'm going to show you part of the code used in SM63's player engine. Don't take it as a sign of defeat if you can't understand it. Rome wasn't built in a day, and Jobs didn't create the Macintosh flawlessly in his parent's garage. It takes practice and time, even for the best.
- Code: Select all
{
StunTime--;
if(Water == true)
{
StunTime = StunTime - 3;
}
else
{
_root.Controll = false;
}
}
if(blink > 0)
{
blink--;
if(blink / 3 == Math.round(blink / 3))
{
charClip.frame._alpha = 20;
}
else
{
charClip.frame._alpha = 70;
}
}
else
{
charClip.frame._alpha = 100;
}
if(yspeed > -3)
{
lockon = true;
}
else
{
lockon = false;
}
if(_root.CanSwitchFludd == true)
{
if(!_root.KeySHIFT())
{
canChangeFludd = true;
}
if(_root.KeySHIFT() && canChangeFludd == true)
{
changeFludd = true;
canChangeFludd = false;
}
else
{
changeFludd = false;
}
if(attack == false)
{
_root.ChangeFludd();
}
}
if(_root.newstar == true && !(attackFrame == "Star" && attack == true) && _root.Playinglevel == 0)
{
attack = true;
attackFrame = "ExitPainting";
}
if(attackFrame == "Star")
{
_root.CameraZoom = 100;
if(yspeed > 7)
{
yspeed = yspeed * 0.95;
}
}
if(attackFrame == "frontflip" && attack == true && !_root.Fluddpow == "")
{
attack = false;
}
if(_root.LastFrameJumpPress == false && _root.KeyUP())
{
_root.JumpPress = 7;
}
else
{
_root.JumpPress = _root.JumpPress - 1;
}
_root.LastFrameJumpPress = _root.KeyUP();
if(air == true)
{
if(Water == true)
{
if(_root.Course.Water.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y - tall / 2) * _root.coursescale / 100 + _root.Course._y,true))
{
if(attackFrame == "Star")
{
yspeed = yspeed + _root.gravity / 3;
}
else if(!(_root.Metal === true))
{
yspeed = yspeed + _root.gravity / 3;
}
else
{
yspeed = yspeed + _root.gravity / 2;
}
}
yspeed = _root.groundFriction(yspeed,0.05,1.01);
}
else
{
yspeed = yspeed + _root.gravity;
if(_root.PowerTimer && _root.WingCap == true && yspeed > 3)
{
yspeed = yspeed - _root.gravity / 6;
fallingyspeed = _root.groundFriction(yspeed,_root.gravity / 4.5,1.07);
}
else
{
fallingyspeed = _root.groundFriction(yspeed,_root.gravity / 5,1.05);
}
if(yspeed > 0)
{
if(attack == false && yspeed > 7)
{
fallcount++;
if(_root.KeySPACE() && _root.Power > 0 && _root.WaterAmount > 0 && _root.Fluddpow == "H")
{
fallcount = 0;
hurtfallcount--;
hurtfallcount = Math.max(hurtfallcount,0);
}
if(!(fallingyspeed < 15) && air == true && yspeed > 15 && !(fallingsfx === true))
{
hurtfallcount++;
hurtfallcount = Math.min(hurtfallcount,7);
if(!(hurtfallcount < 5))
{
fallingsfx = true;
_root.Mariosound = new Sound(this);
_root.Mariosound.attachSound("Mario-Fall");
_root.Mariosound.start(0,1);
_root.Mariosound.setVolume(_root.MarioVolume);
}
}
}
else
{
fallcount = Math.round(fallcount / 2);
}
yspeed = _root.groundFriction(yspeed,_root.gravity / 5,1.05);
}
else
{
fallcount = 0;
hurtfallcount--;
hurtfallcount = Math.max(hurtfallcount,0);
}
}
yspeed = _root.groundFriction(yspeed,0,1.001);
xspeed = _root.groundFriction(xspeed,0,1.001);
if(attack == false)
{
if(Water == false)
{
if(yspeed > 2)
{
frame = 4;
}
else
{
frame = 3;
}
}
if(!_root.KeyDOWN() && !_root.KeyZ() || air == false)
{
divewaitcount = divewaitcount - 3;
}
divewaitcount = divewaitcount - 1;
if(_root.KeyZ() && (Water == false || _root.Metal == true) && !(divewaitcount > 0) && !_root.Course.Platforms.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y + 5) * _root.coursescale / 100 + _root.Course._y,true) && !_root.Course.BPlatforms.hitTest(_X * _root.coursescale / 100 + _root.Course._x,(_Y + 5) * _root.coursescale / 100 + _root.Course._y,true))
{
yspeed = 0;
xspeed = 0;
attack = true;
attackFrame = "Ground";
}
if(_root.KeyDOWN() && (Water == false || _root.Metal == true) && !(divewaitcount > 0))
{
attack = true;
if(_xscale < 0)
{
xspeed = xspeed - (xspeed - _root.Divespeed) / 5;
}
else
{
xspeed = xspeed - (xspeed + _root.Divespeed) / 5;
}
if(_root.WingCap == true)
{
attackFrame = "Flying";
yspeed = yspeed * 0.5;
}
else
{
attackFrame = "Dive";
yspeed = yspeed + 3;
if(_root.CurrentPlayer == "Mario")
{
soundj = "Mario-Dive";
}
if(_root.CurrentPlayer == "Luigi")
{
if(random(2) == 1)
{
soundj = "Luigi - Yah!";
}
else
{
soundj = "Luigi - Yuh!";
}
}
_root.Mariosound = new Sound(this);
_root.Mariosound.attachSound(soundj);
_root.Mariosound.start(0,1);
_root.Mariosound.setVolume(_root.MarioVolume);
}
}
if(_root.KeyRIGHT() && _root.Controll == true)
{
xspeed = xspeed - Math.min((xspeed - _root.airwalkspeed) / _root.airmaxWalkspeed / 3,0);
_xscale = -100;
if(_root.KeySPACE() && _root.Power > 0 && _root.WaterAmount > 0 && _root.Fluddpow == "H")
{
_rotation = _rotation + 5;
xspeed = xspeed - Math.min((xspeed - _root.airwalkspeed) / _root.airmaxWalkspeed,0);
}
}
if(_root.KeyLEFT() && _root.Controll == true)
{
xspeed = xspeed - Math.max((xspeed + _root.airwalkspeed) / _root.airmaxWalkspeed / 3,0);
_xscale = 100;
if(_root.KeySPACE() && _root.Power > 0 && _root.WaterAmount > 0 && _root.Fluddpow == "H")
{
_rotation = _rotation - 5;
xspeed = xspeed - Math.max((xspeed + _root.airwalkspeed) / _root.airmaxWalkspeed,0);
}
}
if(_root.KeyTapRIGHT() && !_root.KeyRIGHT() && _root.Controll == true)
{
xspeed = xspeed - Math.min((xspeed - _root.airtapspeed) / _root.airmaxtapWalkspeed / 3,0);
_xscale = -100;
if(_root.KeySPACE() && _root.Power > 0 && _root.WaterAmount > 0 && _root.Fluddpow == "H")
{
_rotation = _rotation + 5;
xspeed = xspeed - Math.min((xspeed - _root.airtapspeed) / _root.airmaxtapWalkspeed,0);
}
}
if(_root.KeyTapLEFT() && !_root.KeyLEFT() && _root.Controll == true)
{
xspeed = xspeed - Math.max((xspeed + _root.airtapspeed) / _root.airmaxtapWalkspeed / 3,0);
_xscale = 100;
if(_root.KeySPACE() && _root.Power > 0 && _root.WaterAmount > 0 && _root.Fluddpow == "H")
{
_rotation = _rotation - 5;
xspeed = xspeed - Math.max((xspeed + _root.airtapspeed) / _root.airmaxtapWalkspeed,0);
}
}
}
Let's just say you shouldn't expect to jump right into programming without first making your Hello World's. Also, there are no good tutorials. That does not mean they are all bad, it just means no one is better than the other. You have to find what works for you.
Hell, I'm trying to learn VBS right now, along with Java and other programming languages, and I'm still not past the beginner's stages. The most I can do is HTML and CSS, but that doesn't stop me.