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 08-22-2002, 12:22 AM   #1
way2good4u_uk
Registered User
 
Join Date: Aug 2002
Location: UK
Posts: 6
Send a message via Yahoo to way2good4u_uk
Default first flash game please view and help

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"+depthCounte r, 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;
way2good4u_uk is offline   Reply With Quote
Old 08-22-2002, 05:38 AM   #2
zoomfreddy
anything...are you sure?
 
zoomfreddy's Avatar
 
Join Date: Jul 2001
Location: Mexico City
Posts: 560
Default

Nice game here

mmm, you don't tell what you want to do with it or what is not working(or im missing something here?), anyway...:

remove the cow when it hits the trucks, increase the speed on enemy trucks, center the trucks on each track... spend a little more time on graphics (i love the cow as it is now!!), good luck!!!

zoomfreddy is offline   Reply With Quote
Old 08-22-2002, 08:50 AM   #3
way2good4u_uk
Registered User
 
Join Date: Aug 2002
Location: UK
Posts: 6
Send a message via Yahoo to way2good4u_uk
Default thanks

the thing i really want to know is how to wite a statement that

if the dynamic score box "SCORE" reaches a certain number the movie goes and to and play a new level (another frame number)


im not sure where to do this as im not sure how to check the score value and i dont know how to send the movie to a certain frame

any help would be brilliant

thanks

ps sorry about the very garbled post but it was very late when i posted it
way2good4u_uk is offline   Reply With Quote
Old 08-22-2002, 05:14 PM   #4
zoomfreddy
anything...are you sure?
 
zoomfreddy's Avatar
 
Join Date: Jul 2001
Location: Mexico City
Posts: 560
Default

ahhhh, ok do this:

on a empty mc as a movieclip event:
ActionScript Code:
onClipEvent (enterFrame) {     if (_root.score<10000) {         _root.gotoAndPlay("nextLevel");     } }

zoomfreddy is offline   Reply With Quote
Old 08-22-2002, 09:10 PM   #5
way2good4u_uk
Registered User
 
Join Date: Aug 2002
Location: UK
Posts: 6
Send a message via Yahoo to way2good4u_uk
Default thanks everyone

to everyone that has helped me in here .....

ive nearly finished my game

http://www.texicare.co.uk/test/game/game.html

thank you for the tips and tricks i am very happy for it to be my first game

charlie

ps if anyone knows why the trucks go over the top of the bridges on the secound level (even though the bridge layer is above the truck layer) please say as i will have to take it off otherwise

thanks again
way2good4u_uk 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


All times are GMT. The time now is 09:16 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.