Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > General > Gaming and Game Development

Reply
 
Thread Tools Rate Thread Display Modes
Old 05-23-2005, 06:53 PM   #1
RENEE0
Registered User
 
Join Date: May 2005
Posts: 3
Exclamation [AS2] Similar Game to "Snake"

I'm in a class at school called "CTA" (Computer Technology Applications), which is basically learning Macromedia Flash. We're supposed to make a game for our final project of entirely our own idea. My game idea was to make a game almost exactly like Neopets' game, "Meerca Chase". If any of you have ever played it, you know it's basically a spin-off of the game "Snake".
Does anyone have any idea as to what the ActionScript for the "Snake"/"Meerca" movement would be like?

Here's a link to Meerca Chase II. Neopets deleted Meerca Chase I from their website. Honestly, my goal is for this game to be a replica of the original Meerca Chase, but with different graphics. With that said, does anyone have any ideas on the ActionScripting involved for a game like this to work? My parameters I needed are something like the following:

ActionScript Code:
onClipEvent (enterFrame) {     if (Key.isDown(Key.RIGHT)) {         setProperty("", _rotation, "0");         _root.tadpole._x++;     }     if (Key.isDown(Key.LEFT)) {         _root.tadpole._x--;         setProperty("", _rotation, "-180");     }     if (Key.isDown(Key.UP)) {         _root.tadpole._y--;         setProperty("", _rotation, "-90");     }     if (Key.isDown(Key.DOWN)) {         setProperty("", _rotation, "90");         _root.tadpole._y++;     } }

My game involves eggs following a tadpole. I have the tadpole movement down, except I need the tadpole to go in a given direction on keypress, and to keep going in that direction without the key being held down.

Also, I need to eggs to follow the tadpole. What kind of script would I use to do something like this?
RENEE0 is offline   Reply With Quote
Old 05-23-2005, 07:47 PM   #2
eclection
Hand-coding Bastard
 
eclection's Avatar
 
Join Date: May 2005
Location: Yukon, Oklahoma
Posts: 100
Send a message via AIM to eclection Send a message via MSN to eclection Send a message via Yahoo to eclection
Default

You could do the entire game within one frame.

ActionScript Code:
var direction = "left"; var length = 1; speed = 500; //difficulty setting var intMain = setInterval(main, speed); var keys = new Object(); keys.onKeyUp = function() {   if (Key.getCode(Key.UP) && direction!="down") direction = "up";   if (Key.getCode(Key.DOWN) && direction!="up") direction = "down";   if (Key.getCode(Key.LEFT) && direction!="right") direction = "left";   if (Key.getCode(Key.RIGHT) && direction!="left") direction = "right"; } Key.addListener(keys); function main() {    // im assuming the game screen is broken down into squares    // so i would create a multi-dimensional denoting what is where    // in the matrix   updateMatrix();   checkForCollision(); //determine if hit self or eating something }
eclection is offline   Reply With Quote
Old 05-24-2005, 06:33 PM   #3
RENEE0
Registered User
 
Join Date: May 2005
Posts: 3
Exclamation

Okay. So, I forgot to mention that the beginning of this semester was my first time even looking at ActionScript. What I'm trying to say is, I'm a total noob. All I know is HTML and CSS, and now just a small bit of ActionScript. Sorry about all this, you'll have to bear with me here as I learn this stuff.

Right now, I see that I should have a "matrix". I'm guessing that's like a grid of squares so that my tadpole can move over one sqare at a time. So, now my problem is that the clip doesn't move, because I don't have a matrix. Is this simple to set up?

Apologies for the terrible ActionScript skill. :\

Last edited by RENEE0; 05-24-2005 at 07:09 PM.
RENEE0 is offline   Reply With Quote
Old 05-25-2005, 12:22 PM   #4
RENEE0
Registered User
 
Join Date: May 2005
Posts: 3
Default

Is there anyone that knows how to help me?
RENEE0 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 11:30 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.