Skater Game

Hey people.

I’m after developing a game where a skateboarder skate along and jumps a distance. The longer the distance the better the score.

I want it to work like the old fashioned games ie: The user has to press HJ really fast to build up speed then press and hold space to build up the jump energy and upon release he will jump etc.

What is the starting point for something like this? Do anyone know of any tuts that are like this/ or any advice work be great.

thanks MIKE

You could go like
//u’ll need the ascii code for the letter ‘h’
//and put it where h is
on(keyDown(Key.H)){
_root.speed+= 1;
}
//same for j
on(keyDown(Key.J)){
_root.speed+= 1;
}
then at the time he jumps have like
have initial variable as goingUp = true; and jumping = true;
this’ll make him fly up and down in a diagonal, the higher _root.speed
the faster he’ll do it
//or whateva, doesn’t have to be 20
if(_root.speed>20){
//do flying animation
if(goingUp){
this._x += _root.speed;
this._y -= _root.speed;
}
if(this._y< 100){
goingUp = false;
}
if(this._x<400){
jumping = false;
}
if(!goingUp && jumping){
this._x +=_root.speed;
this._y += _root.speed;
}
and then _root.score = _root.speed
or something, is this sort of what u want

Thanks for that. I will get started at least now. Lots to do and no time as per.

If anyone knows of full tuts as well that would be great.

I’m not quite sure where u could find a tute on this, as i don’t really know what it is ur trying to do, do u have a link i could go to and i could probably give u more info

Something on the lines of this.

http://www.thearmchairgames.tv/

Click on the soaft long jump!

Yay i got 10.25, i got a new world record. yeah making the projectory of the jump is sort of beyond me in just my head, you’ll need to use like a quadratic function, look at source for games like scorched earth where u fire a projectile that follows that sort of path, cos until u know that it’ll be hard to make, so yeah look at flashkit.com for source for that

thanks again. Will do!

And well done record holder haha

Yeah i’m a record holder but i don’t really want to submit my details to them

I’m doing physics in my last year at school at the moment, and u might need to use vertical velocity = vsin theta, horizontal = v cos theta. or translation in to flash
//and speed was got by pressing left and right
//where angle found is used by pressing space
//obviously u need to have this between 0 and 90
this._y = speedsin(angleFound);
this._x = speed
cos(angleFound);
but this won’t work, cos u’ll need a time factor added in there somewhere, i’m not quite sure how!!

If anyone else know of any source code that I could have a look at. It would be a big help.

thanks

Hmmm thanks. I’ve only just started this project and already its driving me mad grrrr

Hi,
I don’t know how far you have gotten with it so far but as I do far too often I got both bored and nerdy at the same time and whiped this up.
At this point;

  • It doesn’t use any method to jump other than ‘The jump bar’, so not shift pushing.
  • It doesn’t have a complete scrolling background
    (But you’ve got to have somthing to do, right :p)

Also the ugly bar at the top (in contrast to the ugly everything-else under that) was going to be a quick ‘map’ but it works off when the jump bar is set in motion, not it’s distance from the skater. This is due to the use of a variable to keep distance that cannot be anticipated on load (when the map is set up).

Anyway, as I said this was just a quick example but hopefully it atleast somewhat clear. Any questions can be posted here.

Good luck.

The attachment is in MX (I learnt from my MX2K4 save file mistakes :p)

Dinner Dog! Thanks so much for that, as you prob can tell I’m not a techie, I’m a designer really but love flash etc.

I will have a good play with your file today. As far as I figure it I just need to add the graphics and the jump action etc. I know not as simple as that but I’ll get there in about 2009 or so. hehe

thanks again matie

Anyone know how to add the jump function? like http://www.thearmchairgames.tv/

Also would it be possible to make things a bit harder by making it so when you stop pressing left/right it slows down? Sorry for all the questions.

thanks

you could have it so that u add 5 to your speed every time you press the buttons but at the end of every frame it takes out 1 or 2 points but u add 5, or something

as for the jumping i think u would need a for loop that is called when needed something like

for(i=0; i<Math.PI; i++){ //flash works in radians!<math.pi ;="" i="" works="" in="" radians="">
_root.player._x = speed + Math.cos(i);
_root.player._y = speed + Math.sin(i);
}
i’m not sure how u’d do this slower, except have smaller increments (i/5) or something, yeah, i could make u something but i don’t have time at the moment sorry</math.pi>

Ok man made a quick fla for u, should help u to see what to do, i haven’t made an angle changer, but u would just change a variable in the y movement, now just need some tasty graphics!

HEY. Thanks for that. Not had a chance to have a look yet as I’m at home, Will be on it first thing monday. Will let you know how things are going then.

thanks matie (I’m sure I will be back for for questuions hehe)

that’s cool, i don’t know if i’ll be able to answer them though ;), i’ll like to see what u come up with