The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.39 / 5.00 38,635 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.09 / 5.00 15,161 Viewshey guys, i recently got into as2.0 programming and stuff, and i know that many others would like to as well, so.
here is a list of useful codes you can use
mouse follow code
onClipEvent (enterFrame) {
Mouse.hide();
this._x = _root._xmouse;
this._y = _root._ymouse;
}
arrow key movement code
onClipEvent(enterFrame) {
if(Key.isDown(Key.LEFT)) {
this._x -=10;
}
if(Key.isDown(Key.RIGHT)) {
this._x +=10;
}
if(Key.isDown(Key.UP)) {
this._y -=10;
}
if(Key.isDown(Key.DOWN)) {
this._y +=10;
}
}
example:http://www.fileize.com/view/b3da 331a-4b6/
character movement codes
onClipEvent (load) {
var ground:MovieClip = _root.ground;
var grav:Number = 0;
var gravity:Number = 2;
var speed:Number = 7;
var maxJump:Number = -12;
var touchingGround:Boolean = false;
}
onClipEvent (enterFrame) {
_y += grav;
grav += gravity;
while (ground.hitTest(_x, _y, true)) {
_y -= gravity;
grav = 0;
}
if (ground.hitTest(_x, _y+5, true)) {
touchingGround = true;
} else {
touchingGround = false;
}
if (Key.isDown(Key.RIGHT)) {
_x += speed;
}
if (Key.isDown(Key.LEFT)) {
_x -= speed;
}
if (Key.isDown(Key.UP) && touchingGround) {
grav = maxJump;
}
if (ground.hitTest(_x+(_width/2), _y-(_height/2), true)) {
_x -= speed;
}
if (ground.hitTest(_x-(_width/2), _y-(_height/2), true)) {
_x += speed;
}
if (ground.hitTest(_x, _y-(height), true)) {
grav = 3;
}
}
barrier codes
right block
onClipEvent (enterFrame){
if(_root.char.hitTest(this)){
_root.char._x-=10;
}
}
left block
onClipEvent (enterFrame){
if(_root.char.hitTest(this)){
_root.char._x+=10;
}
}
top block
onClipEvent (enterFrame){
if(_root.char.hitTest(this)){
_root.char._y+=10;
}
}
down block
onClipEvent (enterFrame){
if(_root.char.hitTest(this)){
_root.char._y-=10;
}
}
quality and mute button codes
quality
on (press) {
if (_quality == "HIGH") {
_quality = "MEDIUM";
} else if (_quality == "MEDIUM") {
_quality = "LOW";
} else if (_quality == "LOW") {
_quality = "HIGH";
}
}
mute
on(release){
if(this._currentframe == 1){
stopAllSounds()
this.gotoAndPlay("on");
}
else if(this._currentframe == 2){
//unmute
this.gotoAndPlay("off");
}
}
hope you find all these useful and get coding :)
where can i learn programing, i do not know one thing about the subject so i need alot of help
First off, ActionScript belongs in the Flash Forum.
Second off, there is an entire thread dedicated to stuff like this: AS: Main. (not to mention the countless amount of flash tutorials on this website, as well as thousands of others)
:)
At 11/19/11 01:02 PM, Momo-the-Monkey wrote: First off, ActionScript belongs in the Flash Forum.
Second off, there is an entire thread dedicated to stuff like this: AS: Main. (not to mention the countless amount of flash tutorials on this website, as well as thousands of others))
thanks
At 11/19/11 01:02 PM, Momo-the-Monkey wrote: First off, ActionScript belongs in the Flash Forum.
Second off, there is an entire thread dedicated to stuff like this: AS: Main. (not to mention the countless amount of flash tutorials on this website, as well as thousands of others))
Well put.