Please Help!
- GameProgrammer
-
GameProgrammer
- Member since: Aug. 17, 2013
- Offline.
-
- Forum Stats
- Member
- Level 01
- Blank Slate
Hello Guys, I am Making a Platform Game in FLASH CS6, I Use AS2, I Almost Finish The Game, But I Really Stuck At One Part..
I Want To Make A Controls (To Change The Character Moving Controls, To Change Graphics and To Change Music Volume)
I Was Trying To Make That A Couple Of Months..
Anything Guys Will Be Really Cool! PLEASE HELP!
- Sam
-
Sam
- Member since: Oct. 1, 2005
- Offline.
-
- Forum Stats
- Moderator
- Level 19
- Programmer
Store the controls in something similar to an associative array (some quick googling and it seems objects are what you want to use in AS2), where the key is a string and the value is the keycode. So you'd have like:
"left" => 37
"right" => 39
"shoot" => 64
Obviously, you need to reference them in your code rather than hard coding the keycode values. You can do the same for your music and graphics if you want to keep it all in one object.
I dunno, you could also just do it with variables, as long as you have some way of allowing the player to edit the values of the variables you reference for music volume or key input then it's no harder than basic variable use.

