Monster Racer Rush
Select between 5 monster racers, upgrade your monster skill and win the competition!
4.18 / 5.00 3,534 ViewsBuild and Base
Build most powerful forces, unleash hordes of monster and control your soldiers!
3.80 / 5.00 4,200 ViewsBasically the way i am doing it at the moment the charachter remains in a stationary point on the stage, and any velocities/gravity originally used to move him is now used to move the stage in the opposite direction.
This works, however when i want to have another movieclip attach to this by saying
addonmc.y = ground.y+amount
It doesn't actually follow it, it seems to slide about.(watch the camel when you jump) Anyway, i really need help now i've been trying various things for days and i've got nothing.
Please help :(
Besy way to scroll
have the code you had before to move the char ,additionally just do this on the root timeline (or doc clas)
x = (Char.x-300)*-1 // ditto for y axis and 300 in place of half whatever your stage height is, it will be a bit rigid so i suggest you ease it
nobody
i don't like that method :P
if you go right to where the slope is and dont jump you lose your character
Use vcam. have it set to the players._x; and ._x; position, Then it will fallow the player, you can have enemies or anything else, but the screen will still scroll with the player.
I always have a problem when I use the VCam in my games, my HUD shakes when the camera moves.
MSN/Email-> kevin.stubbs@live.com -Need artists!
The 9th Legion
(Looking for somebody to create the site for $$$).
I hate vcam, but i can give it a try i suppose. Is there an as3 version?
Does anyone have any betters soloutions?
Nah, I don't think VCam is a good idea that much.
I've been solving this some time ago. If those other movie clips besides your character are enemies or something like that, you can try creating them in the same Movie Clip as the ground is (i.e. ground will be their parent). Therefore, you can move them normally, since the ground is moving with them.
Thats how I solved it anyway.
At 4/1/10 12:39 PM, Depredation wrote: Does anyone have any betters solutions?
Its one of the dumbest things to do when making a game.
The as3 version isn't as bad, but is still horrible practice, and can even slow down the game when many things are happening.
Other than that, HDXMike's way is still a solid way of doing it.
No matter what your weaknesses are, make sure your own abilities supersede them.
Yeah HDXMike seems to be on the right track so thanks for that. Here's what happens when i use that technique however. It Bounces :(
var p:MovieClip = MovieClip($e.target);
p.vx = p.spd*(keys[39]-keys[37]);
p.x += p.vx;
p.grav++;
p.y += p.grav;
MovieClip(root).x = (p.x-stage.stageWidth/2)*-1;
MovieClip(root).y = (p.y-stage.stageHeight/2)*-1;
for each(var u in hArray) {
while(u.hitTestPoint(p.x-15, p.y, true) || u.hitTestPoint(p.x+15, p.y, true)) {
p.y--;
p.grav = 0;
p.jmp = false;
}
if(HitTest.complexHitTestObject(u, hbox, 3)) {
p.x -= p.vx;
}
/*if(HitTest.complexHitTestObject(u, tbox, 3) && p.jmp) {
p.y -= p.grav-1;
p.grav = 0;
}*/
}
That's the code, any help?
At 4/1/10 02:24 PM, Depredation wrote: Please help :( This is really killing me.%u2248%u2248%u2248
God , i SAID it would be rigid , and jumpy which is why i suggested you ease it jesus
example code
RX= (Mike.x-350) *-1;
RY= (Mike.y-270) *-1;
x+=(RX-x)/5;
y+=(RY-y)/30 nobody
What you're doing:
- Moving the player and then checking if the player is hitting the ground. If he is, you shoot him up x pixels.
What you should be doing:
- Checking if the character will be hitting the ground when he moves. If he does, you don't move him.
At 4/1/10 03:29 PM, HDXmike wrote: God , i SAID it would be rigid , and jumpy which is why i suggested you ease it jesus
I did ease, it just wasn't by enough, i'm not an idiot, i just can be stupid with code when it's frustrating me.
Thanks all, especially HDXmike.
At 4/1/10 03:35 PM, CaptainPoncho wrote: - Checking if the character will be hitting the ground when he moves. If he does, you don't move him.%u2248%u2248%u2248
Out of interest, how would you suggest doing that?
At 4/1/10 06:16 PM, Mufanza wrote: Have you considered what I've said?%u2248%u2248%u2248
there is 0 point in your suggestion , mine has the same effect without all that nested MC crap . you can manipulate stage properties like that you know
nobody
At 4/1/10 09:27 PM, HDXmike wrote: there is 0 point in your suggestion , mine has the same effect without all that nested MC crap . you can manipulate stage properties like that you know
Yeah i want to keep this clean and precise, HDX's way allows me to do that. Thanks a lot for the suggestion, i'll credit you. I knew you could just move the stage and i'd already done that, however i was adding onto it's current position rather than just setting it in relation to the players value.
Thanks again Mike.
At 4/2/10 12:43 PM, Depredation wrote: Thanks again Mike.
Your welcome :3
nobody
At 4/1/10 05:07 PM, Depredation wrote:At 4/1/10 03:35 PM, CaptainPoncho wrote: - Checking if the character will be hitting the ground when he moves. If he does, you don't move him.%u2248%u2248%u2248Out of interest, how would you suggest doing that?
If I understood him correctly, then before checking if the correct key is down then moving the player, you check if the player is hitting the ground, only if he's not hitting will he move.
That, or you can do it the way box2D does it, that's to calculate where the object will be in the next frame, if it will be hitting something, then it reacts accordingly, but that's only for fast moving objects that could go through walls.
Mike's solution seems to suffice though.