# Skater Game

**URL:** <https://forum.kirupa.com/t/skater-game/65635>\
**Category:** programming\
**Created:** [September 28, 2004, 10:15am UTC](https://forum.kirupa.com/t/skater-game/65635 "2004-09-28T10:15:13Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![foopot](https://avatars.discourse-cdn.com/v4/letter/f/3da27b/32.png) [@foopot](https://forum.kirupa.com/u/foopot)\
**Post date:** [September 28, 2004, 10:15am UTC](https://forum.kirupa.com/t/skater-game/65635/1 "2004-09-28T10:15:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 28, 2004, 10:59am UTC](https://forum.kirupa.com/t/skater-game/65635/2 "2004-09-28T10:59:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 28, 2004, 11:04am UTC](https://forum.kirupa.com/t/skater-game/65635/3 "2004-09-28T11:04:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 28, 2004, 11:23am UTC](https://forum.kirupa.com/t/skater-game/65635/4 "2004-09-28T11:23:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 28, 2004, 11:32am UTC](https://forum.kirupa.com/t/skater-game/65635/5 "2004-09-28T11:32:24Z")

</div>

Something on the lines of this.

[http://www.thearmchairgames.tv/](http://www.thearmchairgames.tv/)

Click on the soaft long jump!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 28, 2004, 11:45am UTC](https://forum.kirupa.com/t/skater-game/65635/6 "2004-09-28T11:45:56Z")

</div>

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](http://flashkit.com) for source for that

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 28, 2004, 11:48am UTC](https://forum.kirupa.com/t/skater-game/65635/7 "2004-09-28T11:48:22Z")

</div>

thanks again. Will do!

And well done record holder haha

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 28, 2004, 11:52am UTC](https://forum.kirupa.com/t/skater-game/65635/8 "2004-09-28T11:52:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 28, 2004, 11:57am UTC](https://forum.kirupa.com/t/skater-game/65635/9 "2004-09-28T11:57:34Z")

</div>

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 = speed_sin(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!!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 28, 2004, 12:01pm UTC](https://forum.kirupa.com/t/skater-game/65635/10 "2004-09-28T12:01:17Z")

</div>

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

thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 28, 2004, 12:25pm UTC](https://forum.kirupa.com/t/skater-game/65635/11 "2004-09-28T12:25:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 28, 2004, 2:57pm UTC](https://forum.kirupa.com/t/skater-game/65635/12 "2004-09-28T14:57:54Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 29, 2004, 9:27am UTC](https://forum.kirupa.com/t/skater-game/65635/13 "2004-09-29T09:27:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 29, 2004, 9:53am UTC](https://forum.kirupa.com/t/skater-game/65635/14 "2004-09-29T09:53:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 29, 2004, 10:13am UTC](https://forum.kirupa.com/t/skater-game/65635/15 "2004-09-29T10:13:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 1, 2004, 8:49am UTC](https://forum.kirupa.com/t/skater-game/65635/16 "2004-10-01T08:49:08Z")

</div>

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\>

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 3, 2004, 3:56am UTC](https://forum.kirupa.com/t/skater-game/65635/17 "2004-10-03T03:56:25Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 3, 2004, 10:06am UTC](https://forum.kirupa.com/t/skater-game/65635/18 "2004-10-03T10:06:33Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 3, 2004, 12:02pm UTC](https://forum.kirupa.com/t/skater-game/65635/19 "2004-10-03T12:02:41Z")

</div>

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
