The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.36 / 5.00 33,851 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.09 / 5.00 12,195 ViewsI'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.
add this code, and draw a ramp.
var a:Number = 1;
while(a != 0){
a++;
createEmptyMovieClip("a"+a, a);
}
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
} 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?
I AM an animator
I AM a movie creator
I AM a website designer
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.If that doesn't work for you add this instead:
var a:Number = 1;
while(a != 0){
a++;
createEmptyMovieClip("a"+a, a);
}
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!
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.
Do not expect people to create flash for you. Furthermore, the code you provided is not even yours.
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
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?
At 2/21/10 04:25 AM, TheSongSalad wrote:At 2/21/10 04:17 AM, HDXmike wrote: angerwhoa, 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
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 inAND 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.
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
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.
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.
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 :)
At 2/21/10 04:17 AM, HDXmike wrote: rage
You forgot to rip on him for not using code tags.
At 2/21/10 02:07 PM, Archon68 wrote:At 2/21/10 04:17 AM, HDXmike wrote: rageYou forgot to rip on him for not using code tags.
Picture
Thank you archon !
i just knew my rant was missing something
nobody
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!
------------------------------
For anyone who might wonder.
Source of those codes, he just edited a bit.
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!
------------------------------
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.
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.
Pictures don't make you a better person.
At 2/21/10 07:02 PM, zrb wrote:At 2/21/10 06:58 PM, ChaostimpBoy wrote: blehDon'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
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
At 2/21/10 07:02 PM, zrb wrote:At 2/21/10 06:58 PM, ChaostimpBoy wrote: blehDon't go crying now, there are worse noobs.
But please take the time to go learn the basics.
*smiles*
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.
Click to view.
At 2/21/10 07:58 PM, HDXmike wrote:At 2/21/10 06:58 PM, ChaostimpBoy wrote: Sorry americansnot every one here is american , me and sam are brits , woot .BTW archon £ >$
Malaysian.
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!
------------------------------
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