Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > General > Gaming and Game Development

Reply
 
Thread Tools Rate Thread Display Modes
Old 10-23-2001, 10:24 PM   #1
krazieness01
Registered User
 
Join Date: Oct 2001
Location: New Zealand
Posts: 4
Lightbulb My Sidescrolling Game

Hey Everyone! Im making myself a side scrolling game and im not very fond of it.

Ya see im making a game basically like 'Sonic The Hedgehog' Style and i need to know how to my guy jump. I have got the scrolling perfect. the walking left and right, and i can manage the shooting but i need to know how to make it jump up...

If anyone can give me some quick and easy code to put on my character i'd be greatful... catch you all later!
krazieness01 is offline   Reply With Quote
Old 10-24-2001, 02:14 AM   #2
jonstrong
Registered User
 
Join Date: Oct 2001
Posts: 11
Default I can help

Inside your Character MC,

In the first frame, have a stop action, and make an invisible button that says
on keypress (whatever key) Play.
.... and then in the next frame, make an animation of him jumping, and after he jumps, an action
goto and stop (1)

hope i helped
jonstrong is offline   Reply With Quote
Old 10-24-2001, 06:57 AM   #3
krazieness01
Registered User
 
Join Date: Oct 2001
Location: New Zealand
Posts: 4
Default

Ummm actually ya see that wont work. i need to make a velocity thing. because if ya just make an animation of him jumping it will stuff up the part of him landing on another platform if ya know what i mean. Unless of course you had an amazing way of getting past that. anyway thanks for replying it did give me a couple ideas i could try. catch ya later!
krazieness01 is offline   Reply With Quote
Old 10-26-2001, 08:11 AM   #4
Griffith
Registered User
 
Join Date: Oct 2001
Posts: 8
Default

is it possible to have a look at your game.. want to see how your sidescrolling works.. so.. would appreciate to have a look at it.. ??
Griffith is offline   Reply With Quote
Old 10-26-2001, 09:03 AM   #5
krazieness01
Registered User
 
Join Date: Oct 2001
Location: New Zealand
Posts: 4
Default

Well i very well could upload it but its in a very 'sketchy' stage and ill have to re-make it for easy to understand code, if a few more peeps ask for it then ill be sure to get to it right away! laterz~
krazieness01 is offline   Reply With Quote
Old 10-26-2001, 11:49 AM   #6
red penguin
[^\d\D]
 
red penguin's Avatar
 
Join Date: Jun 2001
Location: Brooklyn, NY
Posts: 3,253
Default

Well, you know we all wouldn't mind taking a look at your game! As for a jump idea...
Code:
//FLOORED OBJECT FOR GAME
//Keeps a MC on a defined floor, simple use for building 
//platform jump'n'run games.
//usage:
//this.keepOnFloor(gravity,floor) 
//e.g. this.keepOnFloor(7,_root.ground);

Movieclip.prototype.keepOnFloor=function (gr,floor) {
   this._y+=this._gravity+=gr; 
   var pos=new Object();
   pos.x=this._x; pos.y=this._y;
   for (var i=0; i<=this._gravity; i++) {
      if (floor.hitTest(pos.x,pos.y-i,1)) {
         while (floor.hitTest(pos.x,pos.y- i,1)) {
            pos.y--;
         }
         this._y=pos.y- i;
         this._gravity=0;
      }
   }
}
//usage 
//Draw any shape that shall be your floor and convert it to 
//a Movieclip. Name this MC e.g. "ground".

//Put this on your character:
onClipEvent (enterFrame) {
   if (Key.isDown(Key.RIGHT)) {this._x+=10;}
      if (Key.isDown(Key.LEFT)) {this._x-=10;}
         if (Key.isDown(Key.UP)&&this._gravity==0){
            this._gravity=-50; // JUMP!
         } 

      this.keepOnFloor(7,_root.ground);
}
I believe I got this from this very site but for the life of me I don't remember from who. If anyone can claim credit, then please do so...Sorry for not writing it down!!
I haven't tested it, so that's up to you...
Good luck!
__________________

komielan.com
red penguin is offline   Reply With Quote
Old 10-26-2001, 11:55 AM   #7
krazieness01
Registered User
 
Join Date: Oct 2001
Location: New Zealand
Posts: 4
Default

Wow dude, that code was so much helpful... thanks soooooo much now i can get back to my game and actually tkae it out from the dusty part of my computer from where i left it when i couldnt make a jumping guy lol... catch ya later!
krazieness01 is offline   Reply With Quote
Old 10-26-2001, 12:02 PM   #8
red penguin
[^\d\D]
 
red penguin's Avatar
 
Join Date: Jun 2001
Location: Brooklyn, NY
Posts: 3,253
Default

So, just let us know when you get some progrss and I'd like to see the guy jumping, yeah?
__________________

komielan.com
red penguin is offline   Reply With Quote
Old 10-26-2001, 01:01 PM   #9
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

That's a good little Func Proto you have there Red. Search FK, WH and here and couldn't find any other copies... I'd like to know who wrote it... any memories?
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder
Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Old 10-26-2001, 01:49 PM   #10
red penguin
[^\d\D]
 
red penguin's Avatar
 
Join Date: Jun 2001
Location: Brooklyn, NY
Posts: 3,253
Default

Can't remember at all. I remember seeing it (but where?)and thought, what the hell, copied it, and stuck it away in the archives...I thought it was in the library here, so I searched, then searched like you on the others, but to no avail. I really thought if I searched the forums here I'd come up with it...

Anyone out there knows?
__________________

komielan.com
red penguin is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Card Match Game, Colour Me In Pictures and Board Game Total Frigging ActionScript 2.0 4 02-21-2005 01:04 AM
word search game with AS2 black General Chat 5 08-12-2004 10:44 AM
[AS2] Tile game or not tile game? krolben Gaming and Game Development 4 07-28-2004 01:41 PM
Game - freelancer required fatherb Projects and Positions 6 07-18-2003 12:47 PM


All times are GMT. The time now is 03:54 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.