Be a Supporter!

Help: Sonic Platform Engine

  • 1,179 Views
  • 32 Replies
New Topic Respond to this Topic
ChaostimpBoy
ChaostimpBoy
  • Member since: Feb. 20, 2010
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Help: Sonic Platform Engine 2010-02-20 22:10:01 Reply

I'm only 10 years old and experienced programmer in Flash 8.
I've got lots of good works or projects. My old account has been blocked by Yahoo! (user is frvray)
----------
Anyway, I'm making a platform game, Sonic Platform Engine.

This is code for a player with instance PLAYER: (plz edit it or add script for ramps/slopes)

onClipEvent (load) {
var grav:Number = 0;
// gravity
var speed:Number = 20;
// how fast you walk
var jumpHeight:Number = 20;
// how high you jump
var slow:Number = .7;
// sets water falling speed
var slowspd:Number = speed/1.5;
// sets water walking speed
var setspeed:Number = speed;
var scale:Number = _xscale;
var ex:Number = 5;
// makes hitTests better, change for a closer hitTest (warning, more buggy if smalle, less real if further)
this.gotoAndStop(2);
_root.maxshoottime = 100;
// _root.maxshoottime is set to 100
// this is how far you want the bullets to travel before deleting
}
onClipEvent (enterFrame) {
if (!_root.shooting) {
// if _root.shooting is false
_root.timer = 0;
// _root.timer is set to 0
_root.mvsp = _xscale/20;
// _root.mvsp is set to the chars xscale divided by 20
// the answer to this is the speed of the bullets
}
grav++;
_y += grav;
while (_root.ground.hitTest(_x, _y, true)) {
_y--;
grav = 0;
}
if (_root.water.hitTest(_x, _y, true)) {
if (grav>0) {
grav *= slow;
}
speed = slowspd;
} else {
speed = setspeed;
}
if (Key.isDown(68)) {
_x += speed;
_xscale = scale;
if (_root.ground.hitTest(_x, _y+3, true)) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
}
} else if (Key.isDown(65)) {
_x -= speed;
_xscale = -scale;
if (_root.ground.hitTest(_x, _y+3, true)) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
}
} else {
if (_root.ground.hitTest(_x, _y+3, true) && !Key.isDown(79) && !Key.isDown(73)) {
this.gotoAndStop(3);
}
}
if (Key.isDown(79) && !Key.isDown(87) && !Key.isDown(65) && !Key.isDown(68) && !Key.isDown(73)) {
this.gotoAndStop(5);
}
if (Key.isDown(73) && !Key.isDown(87) && !Key.isDown(65) && !Key.isDown(68) && !Key.isDown(79)) {
this.gotoAndStop(4);
}
if (Key.isDown(87) && _root.ground.hitTest(_x, _y+3, true)) {
grav = -jumpHeight;
_y -= 4;
this.gotoAndStop(2);
}
if (_root.ground.hitTest(_x+(_width/2)+ex, _y-(_height/2), true) || _root.ground.hitTest(_x+(_width/2)+ex, _y-(_height/6), true) || _root.ground.hitTest(_x+(_width/2)+ex, _y-_height, true)) {
_x -= speed;
}
if (_root.ground.hitTest(_x-(_width/2)-ex, _y-(_height/2), true) || _root.ground.hitTest(_x-(_width/2)-ex, _y-(_height/6), true) || _root.ground.hitTest(_x-(_width/2)-ex, _y-_height, true)) {
_x += speed;
}
if (_root.ground.hitTest(_x, _y-_height-15, true)) {
grav = 1;
}
}

AND THE GROUND HAS NO CODE, ITS ALREADY IN PLAYER's CODE.

Help: Sonic Platform Engine

Glaiel-Gamer
Glaiel-Gamer
  • Member since: Dec. 28, 2004
  • Offline.
Forum Stats
Member
Level 28
Game Developer
Response to Help: Sonic Platform Engine 2010-02-20 22:13:16 Reply

add this code, and draw a ramp.

var a:Number = 1;
while(a != 0){
a++;
createEmptyMovieClip("a"+a, a);
}

zrb
zrb
  • Member since: Aug. 8, 2006
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to Help: Sonic Platform Engine 2010-02-20 22:27:38 Reply

At 2/20/10 10:13 PM, Glaiel-Gamer wrote: add this code, and draw a ramp.

var a:Number = 1;
while(a != 0){
a++;
createEmptyMovieClip("a"+a, a);
}

If that doesn't work for you add this instead:

var rampCheck:Number = 0;
while (!_root.ground.hitTest(_x,_y,true)||_root._ground.hitTest(_x,_y,true)) {
//checks for ramps
rampCheck++
trace(rampCheck) 
//that will tell you if its working or not
}

School Sux ! || As :Main || As3: Main || Animation: Main || Flash Tutorials ||

BBS Signature
Patronium20
Patronium20
  • Member since: Feb. 1, 2010
  • Offline.
Forum Stats
Member
Level 07
Blank Slate
Response to Help: Sonic Platform Engine 2010-02-20 22:31:01 Reply

Can I help!? I'm a bit older than ya and you're lucky to have Flash. Anyways, a friend and I can help you with drawings and music, heck maybe even an intro... like this one below. Would you like to join my Sonic collab and club project?

Help: Sonic Platform Engine


I AM an animator
I AM a movie creator
I AM a website designer

ChaostimpBoy
ChaostimpBoy
  • Member since: Feb. 20, 2010
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Response to Help: Sonic Platform Engine 2010-02-20 23:38:10 Reply

At 2/20/10 10:27 PM, zrb wrote:
At 2/20/10 10:13 PM, Glaiel-Gamer wrote: add this code, and draw a ramp.

var a:Number = 1;
while(a != 0){
a++;
createEmptyMovieClip("a"+a, a);
}
If that doesn't work for you add this instead:

var rampCheck:Number = 0;
while (!_root.ground.hitTest(_x,_y,true)||_roo t._ground.hitTest(_x,_y,true)) {
//checks for ramps
rampCheck++
trace(rampCheck)
//that will tell you if its working or not
}

this is confusing, download it and give it back to me if finshed (create badniks too)
Click This for Source File!

ChaostimpBoy
ChaostimpBoy
  • Member since: Feb. 20, 2010
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Response to Help: Sonic Platform Engine 2010-02-21 01:01:06 Reply

At 2/20/10 10:27 PM, zrb wrote: If that doesn't work for you add this instead:

var rampCheck:Number = 0;
while (!_root.ground.hitTest(_x,_y,true)||_roo t._ground.hitTest(_x,_y,true)) {
//checks for ramps
rampCheck++
trace(rampCheck)
//that will tell you if its working or not
}

i think that is as3, i want as2.

rickeyricksricky
rickeyricksricky
  • Member since: Aug. 12, 2008
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to Help: Sonic Platform Engine 2010-02-21 03:23:06 Reply

Do not expect people to create flash for you. Furthermore, the code you provided is not even yours.

Innermike
Innermike
  • Member since: Sep. 11, 2009
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to Help: Sonic Platform Engine 2010-02-21 04:17:02 Reply

At 2/20/10 10:10 PM, ChaostimpBoy wrote: I'm only 10 years old

Fail

and experienced programmer in Flash 8.

this code is disgusting , what you call experienced here is classed only as uber-noob

Anyway, I'm making a platform game, Sonic Platform Engine.

no youre not youre simply modyfying an existing one

This is code for a player with instance PLAYER: (plz edit it or add script for ramps/slopes)

You stole this code , therefore you are not a programmer

onClipEvent

on clip events fail code on timline

AND THE GROUND HAS NO CODE, ITS ALREADY IN PLAYER's CODE.

No clips should have code on them including the player

You are a plagarising little runt thats too young to be on NG anyway if you had written your own code and WERE actually experienced this wouldnt be a problem for you


nobody

TheSongSalad
TheSongSalad
  • Member since: Jan. 17, 2009
  • Offline.
Forum Stats
Member
Level 19
Audiophile
Response to Help: Sonic Platform Engine 2010-02-21 04:25:17 Reply

At 2/21/10 04:17 AM, HDXmike wrote: anger

whoa, chill man, i can understand your upset that he's asking for people to do his work for him, but there's nothing wrong with using other people's code to learn. thats how quite a few people learn how to use flash. i get that he's not doing that, but still, no need to rip on him that hard?

Innermike
Innermike
  • Member since: Sep. 11, 2009
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to Help: Sonic Platform Engine 2010-02-21 04:42:24 Reply

At 2/21/10 04:25 AM, TheSongSalad wrote:
At 2/21/10 04:17 AM, HDXmike wrote: anger
whoa, chill man, i can understand your upset that he's asking for people to do his work for him, but there's nothing wrong with using other people's code to learn. thats how quite a few people learn how to use flash. i get that he's not doing that, but still, no need to rip on him that hard?

Oh no there isnt anything wrong with using someone elses code to learn but thats the thing , hes claiming its his own and hes a programmar and asking us to put the code in

AND the code sucks o__o

nobody

TheSongSalad
TheSongSalad
  • Member since: Jan. 17, 2009
  • Offline.
Forum Stats
Member
Level 19
Audiophile
Response to Help: Sonic Platform Engine 2010-02-21 04:56:41 Reply

At 2/21/10 04:42 AM, HDXmike wrote:
Oh no there isnt anything wrong with using someone elses code to learn but thats the thing , hes claiming its his own and hes a programmar and asking us to put the code in

AND the code sucks o__o

yeah, i totally get what your saying , he's just trying to get us to make the game for him because he doesn't understand how to modify the code to fit his needs. and thats just it, i think he needs a few good beginners flash tuts instead of being bitched at. i totally understand where your coming from though man, it kinda pisses me off that hes claiming its his own too. he didnt even bother to remove the comments.

Innermike
Innermike
  • Member since: Sep. 11, 2009
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to Help: Sonic Platform Engine 2010-02-21 05:57:43 Reply

At 2/21/10 04:56 AM, TheSongSalad wrote: yeah, i totally get what your saying , he's just trying to get us to make the game for him because he doesn't understand how to modify the code to fit his needs. and thats just it, i think he needs a few good beginners flash tuts instead of being bitched at. i totally understand where your coming from though man, it kinda pisses me off that hes claiming its his own too. he didnt even bother to remove the comments.

Wow i do need to calm down :) kid you need to learn AS properly so that you can build things easily with logic once you get the syntax right , try getting a good AS book or something


nobody

rickeyricksricky
rickeyricksricky
  • Member since: Aug. 12, 2008
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to Help: Sonic Platform Engine 2010-02-21 05:59:36 Reply

At 2/21/10 05:57 AM, HDXmike wrote: Wow i do need to calm down :) kid you need to learn AS properly so that you can build things easily with logic once you get the syntax right , try getting a good AS book or something

Better.

henke37
henke37
  • Member since: Sep. 10, 2004
  • Offline.
Forum Stats
Member
Level 30
Blank Slate
Response to Help: Sonic Platform Engine 2010-02-21 06:24:21 Reply

Sonic games are harder to program than normal platforming games. They actually require taking collision detection seriously. The speeds are too high for getting by with "close enough" and the various ground shapes requires things like vectors. You are not going to be able to do this until say, flash 18 or so, because learning these subjects takes time, many lots of time.


Each time someone abuses hittest, God kills a kitten. Please, learn real collision testing.

Sam
Sam
  • Member since: Oct. 1, 2005
  • Offline.
Forum Stats
Moderator
Level 19
Programmer
Response to Help: Sonic Platform Engine 2010-02-21 09:44:21 Reply

At 2/21/10 06:24 AM, henke37 wrote: Sonic games are harder to program than normal platforming games. They actually require taking collision detection seriously. The speeds are too high for getting by with "close enough" and the various ground shapes requires things like vectors. You are not going to be able to do this until say, flash 18 or so, because learning these subjects takes time, many lots of time.

Was about to say something similar.

..well, just that Sonic-esque platformers are alot harder :)

Archawn
Archawn
  • Member since: Sep. 9, 2007
  • Offline.
Forum Stats
Member
Level 27
Game Developer
Response to Help: Sonic Platform Engine 2010-02-21 14:07:01 Reply

At 2/21/10 04:17 AM, HDXmike wrote: rage

You forgot to rip on him for not using code tags.

Picture

Innermike
Innermike
  • Member since: Sep. 11, 2009
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to Help: Sonic Platform Engine 2010-02-21 14:23:38 Reply

At 2/21/10 02:07 PM, Archon68 wrote:
At 2/21/10 04:17 AM, HDXmike wrote: rage
You forgot to rip on him for not using code tags.

Picture

Thank you archon !

i just knew my rant was missing something


nobody

Hoeloe
Hoeloe
  • Member since: Apr. 29, 2004
  • Offline.
Forum Stats
Member
Level 37
Game Developer
Response to Help: Sonic Platform Engine 2010-02-21 15:12:07 Reply

The code style he's using is enough to get by with most things (or at least was until people realised that AS3 handles code much better), though the fact he's 10, claims to be an experienced programmer, is blatantly ripping code straight from a tutorial AND wants us to add code into his engine makes me sick.

However, when he looked at that bit of relatively simple code and said: "I think that's AS3" because he didn't understand it, I just wanted to burst out laughing.

No-ones going to do it for you, kid. Like everyone else, just learn it yourself.

Oh, and because I'm a killjoy, those first two pieces of code people posted in response are just creating infinite loops to crash flash. They were making fun of the fact you didn't really know what you were doing.


Song of the Firefly is on Steam Greenlight and Kickstarter. Give them a look and support the project!
------------------------------

BBS Signature
zrb
zrb
  • Member since: Aug. 8, 2006
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to Help: Sonic Platform Engine 2010-02-21 15:35:22 Reply

For anyone who might wonder.
Source of those codes, he just edited a bit.


School Sux ! || As :Main || As3: Main || Animation: Main || Flash Tutorials ||

BBS Signature
Hoeloe
Hoeloe
  • Member since: Apr. 29, 2004
  • Offline.
Forum Stats
Member
Level 37
Game Developer
Response to Help: Sonic Platform Engine 2010-02-21 15:55:39 Reply

At 2/21/10 03:35 PM, zrb wrote: For anyone who might wonder.
Source of those codes, he just edited a bit.

I suspected it was this code. I did a modification of this myself for a basic AI tutorial a while back, I wouldn't be surprised if he'd put my code up here too...


Song of the Firefly is on Steam Greenlight and Kickstarter. Give them a look and support the project!
------------------------------

BBS Signature
ChaostimpBoy
ChaostimpBoy
  • Member since: Feb. 20, 2010
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Response to Help: Sonic Platform Engine 2010-02-21 18:58:42 Reply

Sorry americans, I post without shame. this is result of my post, can i delete this post? this post maybe worst. i am liar. i'm filipino. if you don't understand, delete this digusting codes and post.

I guess this is what you think who am i (picture below), thanks! feel free for source code. i don't expect peoples that they editing my flash for me.

Help: Sonic Platform Engine

zrb
zrb
  • Member since: Aug. 8, 2006
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to Help: Sonic Platform Engine 2010-02-21 19:02:23 Reply

At 2/21/10 06:58 PM, ChaostimpBoy wrote: bleh

Don't go crying now, there are worse noobs.

But please take the time to go learn the basics.


School Sux ! || As :Main || As3: Main || Animation: Main || Flash Tutorials ||

BBS Signature
Sam
Sam
  • Member since: Oct. 1, 2005
  • Offline.
Forum Stats
Moderator
Level 19
Programmer
Response to Help: Sonic Platform Engine 2010-02-21 19:03:06 Reply

Pictures don't make you a better person.

Farza
Farza
  • Member since: Sep. 17, 2009
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to Help: Sonic Platform Engine 2010-02-21 19:10:22 Reply

At 2/21/10 07:02 PM, zrb wrote:
At 2/21/10 06:58 PM, ChaostimpBoy wrote: bleh
Don't go crying now, there are worse noobs.

But please take the time to go learn the basics.

*Cough* Punisher33 and lgnxhll *Cough*

But seriously, keep practicing. If your 10 and you COMPLETELY UNDERSTAND that code. Then you could be really awesome with AS.


I am a FAB

BBS Signature
Innermike
Innermike
  • Member since: Sep. 11, 2009
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to Help: Sonic Platform Engine 2010-02-21 19:58:06 Reply

At 2/21/10 06:58 PM, ChaostimpBoy wrote: Sorry americans

not every one here is american , me and sam are brits , woot .

BTW archon £ >$

nobody

ChaostimpBoy
ChaostimpBoy
  • Member since: Feb. 20, 2010
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Response to Help: Sonic Platform Engine 2010-02-21 22:45:12 Reply

At 2/21/10 07:02 PM, zrb wrote:
At 2/21/10 06:58 PM, ChaostimpBoy wrote: bleh
Don't go crying now, there are worse noobs.

But please take the time to go learn the basics.

*smiles*

rickeyricksricky
rickeyricksricky
  • Member since: Aug. 12, 2008
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to Help: Sonic Platform Engine 2010-02-22 02:17:45 Reply

At 2/21/10 03:35 PM, zrb wrote: For anyone who might wonder.
Source of those codes, he just edited a bit.

No, he did not edit it from there. He copied it from here.

rickeyricksricky
rickeyricksricky
  • Member since: Aug. 12, 2008
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to Help: Sonic Platform Engine 2010-02-22 02:21:49 Reply

At 2/21/10 07:58 PM, HDXmike wrote:
At 2/21/10 06:58 PM, ChaostimpBoy wrote: Sorry americans
not every one here is american , me and sam are brits , woot .

BTW archon £ >$

Malaysian.

Hoeloe
Hoeloe
  • Member since: Apr. 29, 2004
  • Offline.
Forum Stats
Member
Level 37
Game Developer
Response to Help: Sonic Platform Engine 2010-02-22 02:39:32 Reply

At 2/21/10 07:58 PM, HDXmike wrote: not every one here is american , me and sam are brits , woot .

Don't forget me. Brit here too.

Everyone started a noob. The way we dealt with that is what makes us different. Pretending to be good at code and asking people to code for you will result in you being shunned. However, if you ask with a general intent to learn code, and ask in an understandable and helpful format, people will be inclined to give you help. Eventually, you will pick up the language. However, I recommend working with AS3. It's a much better language and is easier to step into more complex languages than Actionscript.

Just remember: 10 is very young to be starting script. I started when I was 11, and didn't make anything of note until I was 14, when I had a front-paged submission. It takes a lot of work.


Song of the Firefly is on Steam Greenlight and Kickstarter. Give them a look and support the project!
------------------------------

BBS Signature
HonterGames
HonterGames
  • Member since: Jun. 18, 2009
  • Offline.
Forum Stats
Member
Level 08
Blank Slate
Response to Help: Sonic Platform Engine 2010-02-22 04:25:41 Reply

AUSTRALIAN... britains younger brother :(

Um yeah kid go learn from the tutorials rather than copy/pasting the code. It mite take you a good couple of years but flash game programming is a good hobby, even part time job in some cases


BBS Signature