Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 11-07-2010, 04:06 PM   #1
Registered User
Join Date: Nov 2010
Posts: 30
Red face [AS3] location defining

Hi,im new to actionscript 3 and im makin a simple labyrinth game...and i need your help.
please is there any variable datatype which could define the coordinates of any movieclip on the stage?i mean x and y coordinates...like
var XYlocation:Coordinates
object.x = some number
object.y = some number
and i will also need help with making the walls solid (cause the ball can go through them)
please some simple solutions if there are any ...tnx
for more info,here is my script of the whole game (as you can see im using KeyObject.as from senocular.com)
ActionScript Code:
ball.gotoAndStop('ball'); var Key:KeyObject = new KeyObject(stage); stage.addEventListener(Event.ENTER_FRAME,onenter); function onenter(e:Event):void{     if(Key.isDown(Key.LEFT)){                 ball.x-=2;         } else if(Key.isDown(Key.RIGHT)){                 ball.x+=2;         }else if(Key.isDown(Key.UP)){                 ball.y-=2;         }else if(Key.isDown(Key.DOWN)){                 ball.y+=2;         }     }

Last edited by Orcist; 11-07-2010 at 04:17 PM.
Orcist is offline   Reply With Quote
Old 11-09-2010, 09:00 AM   #2
Senior Member
Join Date: Feb 2008
Posts: 387

Umm, I didn't quite understand your question there, maybe you should explain yourself a bit more, or at-least give us an idea on what exactly you are trying to do.

You can use Objects ( var ball:Object=new Object() and give it custom properties to hold extra coordinates, or what ever, you can specify similar properties in the class of you game object, or you can use a 1d or 2d array.....

If you can't even make walls "solid", then I seriously suggest you read tonypa's tile based tutorials and understand the logic, before proceeding further.
My Site :- http://blog.bluemagica.com

I need a spriter, and a story writer for arcade fighter and a side-view RPG. If you can help, please pm me!
bluemagica is offline   Reply With Quote
Old 11-09-2010, 03:14 PM   #3
Registered User
Join Date: Nov 2010
Posts: 30

yes you are right i didnt red them...i say im just total noob to action script but im happy just tu make a button-click let you open some website xD...and i never heard of this tonype,but it looks good and simple...thanks for tip i will try it ...
Orcist is offline   Reply With Quote

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:52 AM.

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.