Flash Game Help

  • Hamie
  • Born
  • Born
  • Hamie
  • Posts: 1
  • Loc: Malaysia

Post 3+ Months Ago

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
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

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
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

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.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 14 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.