Be a Supporter!

Character posistion

  • 336 Views
  • 4 Replies
New Topic Respond to this Topic
KennyMcB
KennyMcB
  • Member since: Dec. 20, 2004
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Character posistion 2006-11-15 22:16:56 Reply

I havent begun coding this portion of my game but i was wondering if i could get some opinions, and and code refrences.

My game is broken into scenes. My issue is this: If my character is in a scene (given part of a dungeon), and encounters a monster, is then sent to a random scene (battle monster scene), and defeats the monster, how can i send the character back to the scene he was in when he encountered the monster, and make him have the same posistion?

My ideas are to get the x and y of the char and take them down as variables when the player encounters the monster, as well as take the current scene down as a variable. That way once you defeat the monster, it takes those variables, and uses them to send you back to the scene, and exact posistion on the screen.

What is your take on the matter?


"Why can't you draw something happy? Like a kitten? Everybody loves kittens!"

HandsomeJake
HandsomeJake
  • Member since: Feb. 10, 2006
  • Offline.
Forum Stats
Member
Level 18
Blank Slate
Response to Character posistion 2006-11-15 22:33:18 Reply

that seems pretty reasonable. is there a moving background though? if so, how are you going to take care of that?

Blaze
Blaze
  • Member since: Aug. 4, 2005
  • Offline.
Forum Stats
Member
Level 22
Programmer
Response to Character posistion 2006-11-15 22:48:09 Reply

use variables. Have the variables be set at the moment you encounter the monster. When the battle is over, before going back to the main stage make the _x and _y axis' of the hero the same as the variables were before engaging combat. It's simple.

Trunks
Trunks
  • Member since: Jul. 31, 2005
  • Offline.
Forum Stats
Member
Level 22
Musician
Response to Character posistion 2006-11-15 22:52:12 Reply

You can load the variables in the if hitTest statement when the statement returns true and load them up again when the boss is defeated, as was said before.

Good luck.


Web developer, software engineer, musician, all-around nerd.

Dry-Ice
Dry-Ice
  • Member since: Apr. 9, 2003
  • Offline.
Forum Stats
Member
Level 16
Blank Slate
Response to Character posistion 2006-11-16 07:17:03 Reply

Well, if you made everything manually and didn't include any random battles, so you knew where the fights would always take place, you could probably build a remedy for that just using the timeline.

But that would probably make your game kinda dull.

I'm useless when it comes to AS anyway.


BBS Mod, PM me if you have something to report.

BBS Signature