way2good4u_uk
08-21-2002, 11:22 PM
THE PROBLEM IS I HAVNT GOT A CLUE WHERE TO START IVE TRIED INCORPERATING SCRIPTS FROM OTHER EXAMPLES E.T.C BUT I CANT SEEM TO GET THEM TO WORK
IF SOMEONE COULD POINT ME IN THE RIGHT DIRECTION IM SURE I COULD FIGURE OUT THE REST. IM NOT A VERY GOOD ACTIONSCRIPTER I SEEM TO SPEND MY TIME ON
BETWEEN FLASH, SWIFT 3D AND 3DSMAX SIMPLY FOR WEBSITES AND PRESENTATIONS.
IF ANYONE COULD HELP IT WOULD BE GREAT. BECAUSE I THINK ONCE I GET THESE POINTS DONE IT HAS THE POTENTIAL FOR BEING A FUNNY GAME.
ALL THE BEST
CHARLIE DAVEY
IF YOU WOULD LIKE TO SEE WHAT I HAVE DONE ITS http://www.texicare.co.uk/test/game/game.html
//MAIN CODE FOR THE TRUCK AND THE MOVIE
onClipEvent (load) {
moveSpeed = 10;
_root.laser._visible = false;
laserCounter = 1;
scrollx = _root.mainGround.ground._width/3;
scrollStart = false;
maxLasers = 1;
depthCounter = 3;
shotSound = new Sound(this);
shotSound.attachSound("moo");
soundStartabe = true;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.CONTROL) and (laserCounter<=maxLasers)) {
laserCounter++;
shotsound.start();
_root.laser.duplicateMovieClip("laser"+depthCounter, depthCounter);
_root["laser"+depthCounter]._visible = true;
depthCounter++;
if (depthCounter>maxLasers) {
depthCounter = 1;
}
}
if (Key.isDown(Key.RIGHT)) {
if (this._x<scrollx) {
this._x += moveSpeed;
} else {
scrollStart = true;
}
} else if (Key.isDown(Key.LEFT)and this._x>0) {
this._x -= moveSpeed;
}
if (Key.isDown(Key.DOWN)and this._y<300) {
this._y += moveSpeed;
} else if (Key.isDown(Key.UP)and this._y>100) {
this._y -= moveSpeed;
}
}
onClipEvent (keyUp) {
if (Key.getCode() == Key.RIGHT) {
scrollStart = false;
}
}
//CODE FOR THE ENEMY
onClipEvent (load) {
function reset() {
this._x = 750;
this._y = random(200)+100;
enemySpeed = random(4)+1;
this.gotoAndStop(1);
}
reset();
}
onClipEvent (enterFrame) {
if (_root.spaceship.scrollStart) {
this._x -= enemySpeed+_root.mainGround.groundSpeed;
} else {
this._x -= enemySpeed;
}
if (this._x<-10) {
reset();
}
if (this.hitTest(_root.spaceship)) {
_root.gotoAndStop("gameOver");
}
}
// COW CODE
onClipEvent (load) {
laserMoveSpeed = 20;
this._x = _root.spaceship._x+90;
this._y = _root.spaceship._y;
}
onClipEvent (enterFrame) {
if (this._name<>"laser") {
this._x += laserMoveSpeed;
if (this._x>700) {
_root.spaceship.laserCounter--;
this.removeMovieClip();
}
for (i=1; i<=_root.numEnemy; i++) {
if (this.hitTest(_root["enemy"+i])) {
_root.score += 100;
_root["enemy"+i].gotoAndPlay(2);
}
}
}
}
//MAIN STAGE CODE
numEnemy = 3;
for (i=2; i<=numEnemy; i++) {
enemy1.duplicateMovieClip("enemy"+i, i+100);
}
score = 0;
IF SOMEONE COULD POINT ME IN THE RIGHT DIRECTION IM SURE I COULD FIGURE OUT THE REST. IM NOT A VERY GOOD ACTIONSCRIPTER I SEEM TO SPEND MY TIME ON
BETWEEN FLASH, SWIFT 3D AND 3DSMAX SIMPLY FOR WEBSITES AND PRESENTATIONS.
IF ANYONE COULD HELP IT WOULD BE GREAT. BECAUSE I THINK ONCE I GET THESE POINTS DONE IT HAS THE POTENTIAL FOR BEING A FUNNY GAME.
ALL THE BEST
CHARLIE DAVEY
IF YOU WOULD LIKE TO SEE WHAT I HAVE DONE ITS http://www.texicare.co.uk/test/game/game.html
//MAIN CODE FOR THE TRUCK AND THE MOVIE
onClipEvent (load) {
moveSpeed = 10;
_root.laser._visible = false;
laserCounter = 1;
scrollx = _root.mainGround.ground._width/3;
scrollStart = false;
maxLasers = 1;
depthCounter = 3;
shotSound = new Sound(this);
shotSound.attachSound("moo");
soundStartabe = true;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.CONTROL) and (laserCounter<=maxLasers)) {
laserCounter++;
shotsound.start();
_root.laser.duplicateMovieClip("laser"+depthCounter, depthCounter);
_root["laser"+depthCounter]._visible = true;
depthCounter++;
if (depthCounter>maxLasers) {
depthCounter = 1;
}
}
if (Key.isDown(Key.RIGHT)) {
if (this._x<scrollx) {
this._x += moveSpeed;
} else {
scrollStart = true;
}
} else if (Key.isDown(Key.LEFT)and this._x>0) {
this._x -= moveSpeed;
}
if (Key.isDown(Key.DOWN)and this._y<300) {
this._y += moveSpeed;
} else if (Key.isDown(Key.UP)and this._y>100) {
this._y -= moveSpeed;
}
}
onClipEvent (keyUp) {
if (Key.getCode() == Key.RIGHT) {
scrollStart = false;
}
}
//CODE FOR THE ENEMY
onClipEvent (load) {
function reset() {
this._x = 750;
this._y = random(200)+100;
enemySpeed = random(4)+1;
this.gotoAndStop(1);
}
reset();
}
onClipEvent (enterFrame) {
if (_root.spaceship.scrollStart) {
this._x -= enemySpeed+_root.mainGround.groundSpeed;
} else {
this._x -= enemySpeed;
}
if (this._x<-10) {
reset();
}
if (this.hitTest(_root.spaceship)) {
_root.gotoAndStop("gameOver");
}
}
// COW CODE
onClipEvent (load) {
laserMoveSpeed = 20;
this._x = _root.spaceship._x+90;
this._y = _root.spaceship._y;
}
onClipEvent (enterFrame) {
if (this._name<>"laser") {
this._x += laserMoveSpeed;
if (this._x>700) {
_root.spaceship.laserCounter--;
this.removeMovieClip();
}
for (i=1; i<=_root.numEnemy; i++) {
if (this.hitTest(_root["enemy"+i])) {
_root.score += 100;
_root["enemy"+i].gotoAndPlay(2);
}
}
}
}
//MAIN STAGE CODE
numEnemy = 3;
for (i=2; i<=numEnemy; i++) {
enemy1.duplicateMovieClip("enemy"+i, i+100);
}
score = 0;