Flash Game Help

  • Hamie
  • Born
  • Born
  • No Avatar
  • Joined: Nov 09, 2007
  • Posts: 1
  • Loc: Malaysia
  • Status: Offline

Post November 9th, 2007, 12:42 am

Im creating a tile based flash game
below is the map i create:



Map1 =
[ [11, 12, 12, 12, 12, 11, 12, 12, 12, 12, 11, 12, 12, 12, 12, 1],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[0, 0, 1, 0, X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2],
[0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,1],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[13, 14, 15, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];



Map2 = [[12, 11, 12, 12, 12, 11, 12, 12, 12, 12, 11, 12, 12, 12, 12,1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1],
[3, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1],
[0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1],
[1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1],
[5, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1]];




Notice the X the map1 above.



Now the character i created only can move around the map1 and map 2. i want to do my game, once the character step on the x positon and the player press key enter, flash will load another swf file.

how am i going to do that? is it possible. can anyone explain how can i do that? i really need your help.




HELP ME

Thank you..
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post November 9th, 2007, 12:42 am

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Joined: Jul 11, 2005
  • Posts: 1828
  • Loc: In the Great White North
  • Status: Offline

Post November 9th, 2007, 2:52 pm

not exactly sure what your trying to do but to make an interaction occur with a key press you need to use the key class.

http://livedocs.adobe.com/flash/9.0/main/00001136.html
If at first you don't succeed F1... If that doesn't work try Google!
//// Designer, Developer & Teacher - Interactive, Motion and 3D \\\\
Portfolio at WhenImNotSleeping.com
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Joined: Nov 05, 2004
  • Posts: 1254
  • Loc: Ro
  • Status: Offline

Post November 27th, 2007, 12:28 am

heehe, i suppose he already use the key class as long as he says that: "the character i created only can move around the map1 and map 2".
But i bet he copied the code from somewhere without understanding much of it, otherwise it's hard for me to believe that he doesn't know how to do what he wants, since it's much easier than actually create the movement of a character in a map.
The thing is this:
check when user press Enter key, in your main loop, where you test the other keys for movement:
Code: [ Select ]
if (Key.isDown(Key.Enter))
{
  if (currentMap[row, column] == 'x')
  {
      someHolder.loadMovie("someMovie.swf");
  }
}
  1. if (Key.isDown(Key.Enter))
  2. {
  3.   if (currentMap[row, column] == 'x')
  4.   {
  5.       someHolder.loadMovie("someMovie.swf");
  6.   }
  7. }

where row and column represents the current tile and are calculated based on the x,y coordinates of the player reported to the tiles width and height.
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 34 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.