116 Forum Posts by "bp-abby"
Hello all. I'm no AS expert, and I've been tinkering around with some inverse kinematics all day today.
Here is what I've come up with so far, written from scratch.
Basically, I'm trying to figure out the best way to employ some actual physics. How can I convincingly simulate momentum, gravity, and collision with ground/walls?
Here's the code so far (with useless comments from me):
radius = 75;
ground = 400;
Mouse.hide ();
_root.createEmptyMovieClip ("line", 100);
for (i = 0; i <= 4; i++) {
_root.attachMovie ("clip", "clip" + i, i * 10);
_root["clip" + i].pnumber = "p" + i;
}
onEnterFrame = function () {
clip0._x = _xmouse;
clip0._y = _ymouse;
//calculate p1's shit
clip1.yd = clip1._y - clip0._y;
clip1.xd = clip1._x - clip0._x;
clip1.angle = Math.atan2 (clip1.yd, clip1.xd);
clip1._x = clip0._x + Math.cos (clip1.angle) * radius;
clip1._y = clip0._y + Math.sin (clip1.angle) * radius;
//loop setting p2, p3, & p4 in their coordinates
for (i = 2; i <= 4; i++) {
var clip2 = "clip" + i;
_root[clip2]._x = clip0._x + Math.cos (clip1.angle + ((90 * (i - 1)) * Math.PI / 180)) * radius;
_root[clip2]._y = clip0._y + Math.sin (clip1.angle + ((90 * (i - 1)) * Math.PI / 180)) * radius;
}
//Please excuse my illogical line drawing methods
line.clear ();
line.lineStyle (1, 0x000000, 100);
for (i = 0; i < 4; i++) {
var clip = ["clip" + i];
var clip2 = ["clip" + (i + 1)];
line.moveTo (_root[clip]._x, _root[clip]._y);
line.lineTo (_root[clip2]._x, _root[clip2]._y);
line.moveTo (clip0._x, clip0._y);
line.lineTo (_root[clip2]._x, _root[clip2]._y);
}
line.moveTo (clip4._x, clip4._y);
line.lineTo (clip1._x, clip1._y);
};
try this:
onClipEvent (load) {
radius = this._width / 2;
blockradius = block._width / 2;
gravity = 0.5;
yvelocity = 0;
weight = 10;
maxvelocity = weight * 5;
}
onClipEvent (enterFrame) {
//if the yvelocity < maxvelocity then increase gravity pull.
if (yvelocity < maxvelocity) {
yvelocity += gravity;
}
if (this._y > 400 - radius - yvelocity) {
yvelocity *= -.65;
if (yvelocity >= -1.5) {
yvelocity = 0;
}
}
this._y += yvelocity;
}
:)
Show us an example, perhaps?
Do this.
//code
numSplg = 0;
splgCount = 15;
for (var i = 1; i < splgCount; i++) {
numSplg++;
var name = ["splg" + i];
this.attachMovie ("splg", name, this.getNextHighestDepth ());
this[name]._x = random (500);
this[name]._y = random (400);
}
mmm...I took a look at your engine. It's not so much a specific code error, it's just pretty low-grade physics. Like, using "hitTest(_root.ground)" is bound to be inaccurate. Generally, it just needs recoding.
Look around in AS: Main for help in platformer engines.
what do you mean you want to control them?
make sure it's a movieclip, and not a a button or graphic.
explain the problem with detail and description, and maybe even give a link to an example.
thnx for the link, btw. its exactly what i was looking for. : )
i have to make the mp3 player in flash, so uh...im pretty sure it has to do with flash.
Im an ok scripter, but this is something i havent worked with. theres this website, www.landofbrokendreams.com, and its gettin pretty big. the owner, ensellitis, has asked me to create an mp3 player so that each member of the site can have his or her own personal song playing.(like the myspace deal). i can make a simple mp3 player in flash, but this is different. we could have each user upload their song somewhere and give the mp3 player the link, and it would play the song from the url. that way, we dont need a massive hard drive somewhere to store all the songs. can anyone help with this? is there a known way to do what we are trying? any ideas? all help will be appreciated, and credit will be given once it is finished.
all it is is that when your level starts moving up, everything is moving faster. it becomes harder to detect collisions between objects (especially small objects) the faster they move. so when everything starts moving up, its like your character is moving down, and he sinks into the floor a little bit. if it goes fast enough, he may reach a point at which it simply sends him through.
just pick a random techno song or something
srry to double post, but theres a type-o. take out the space in "_totalframes"
try this.
on(press){
_root.mc.gotoAndStop(random(_root.mc._totalfr ames))
}
dude. could you have made that any less clear? try reading your message to yourself, and see if you can understand wtf youre talking about. if you figure it out, than tell me.
Dammit, every time i read one of these conversations i feel like an AS idiot. ah, well. maybe my physics class next term will help me understand. maybe.
agreed. but i'm sure that this persons hentai quiz is going to be so much better. with saves man. SAVES! YESSS!! NOW I CAN LOOK AT PORN WITHOUT MEMORIZING BUTTON PATTERNS!!!
srry tp double post, but ROFLMAO, The-Iron-Fist, you mispelled practically every word in the sentence when you tried to make fun of his intelligence. Please reply when you learn enough grammar to effectively insult somebody.
its not really that hard dude. im only 14, and i could easily program the game you have there. and it will be almost impossible to make a full game without knowing how to program. no, you dont have to have a tech degree. AS is pretty basic. and you dont have to give up youtr life to learn it either. i love flash, but im not a social recluse or anything like that. just team up with a scripter or something. srry, im too busy to help you now.
p.s.
your animations/art are pretty sweet. im sure there are alot of people wiling to help you
onClipEvent (enterFrame) {
_x = -_root._xmouse
_y=-_root._ymouse
}
that should do it.
i agree. new pokemon suck major ass. and who asked what pokemon were? was that supposed to be a joke?
umm...you should prolly explain it a little clearer. if its a button, then use the "rollout" method.
like so:
on(rollOut){
//actions
}
but if its an MC than it will be alittle garder than that. too bad im not going to explain it.
well, simple hittest is pretty inaccurate, but if you have to use it, try this.
make the fists of both your characters into MC's. then add this script into both of them.
onClipEvent(enterFrame){
if(this.hitTest(_root.player1or2.fist)){
gotoAndPlay(reactionframe)
}
}
that will make it a little more accurate. and in case you didn't realize it, change those names into whatever the instance name is for your place
At 1/21/07 05:03 PM, dELtaluca wrote:At 1/21/07 03:29 PM, bp-abby wrote: it wouldn't be too hard to add more particles to the "vehicle" (we call it the pill) but it would take alot of scripting and it would slow down the fps quite a bit.yes it wouldn't be too hard, and it would not require alot of scripting at all, nor slow down the fps quite a bit, not unless youre engine is extremely un organised and badly made.
well, it would be diffucult for me. Im not amazing at AS or anything. if i had to guess, i would bet that my engine actually is poorly made/unorganized. but hey, its good enough for me. and no, to answer the previous question, beautiful productions doesn't have a web site. if you try, you'll prolly get some camera site or something. (those bastards stole our name!)
but i like the idea of collectables and time attack. thanks for the suggestions.
At 1/21/07 08:13 AM, Sir-Davey wrote: My pinky says you didn't have anything to do with the creation of this engine and you're asking whoever made it "how do i turn the white line into something else?".
well your pinky is wrong. it wouldn't be too hard to add more particles to the "vehicle" (we call it the pill) but it would take alot of scripting and it would slow down the fps quite a bit. I know what you mean (whoever said it) about the line showing when youre on a sharp change in slope, and im working on that. I was either going to make it smaller and make the distance of the two "wheels" smaller, and then i dont think it would show so much. As for controls, i could definitely make it so you cant move in the air (good suggestion) but i wouldn't know how to make the controls any easier. maybe one might just have to get used to them.
and please, sir davey in particular, dont accuse me of theft. Im not a theif, and i never will be. this is BP's engine, and we're proud of it.
DAMN this is a good story. Im one of those people that reads all the time, so i know what im talking about. Keep up the good work! cant wait to see what happens.
Once me and my brother walked into my stepmoms house, and out of nowhere a huge-ass cat jumped and latched onto my bro's face. i was laughing too hard to help him, and i continued laughing for about an hour. it may have been the funniest moment of my life.
Sir. You have moved me. 5 stars.
personally, im going to wait for a few months to get it, just so they can work out all the bugs.
but how is it, other than that?

