View Full Version : Cheat bars and making them work?
Leo-The-CRaZeD
April 28th, 2006, 07:40 PM
How do you make the input bar to put in cheats, and the code to allow them to take affect? I remember it having something to do with... Nevermind.
Battleman
April 28th, 2006, 08:56 PM
You are one crazy taco!
Leo-The-CRaZeD
April 28th, 2006, 09:50 PM
... Try answering the question...
Battleman
April 28th, 2006, 10:04 PM
... Try asking a question ...
Maybe you should ask: "Does someone want to figure out what I'm trying to say and then donate time to helping me out???"
Don't forget that people don't owe you anything... and the least you can do is be clear in the question you're asking.
As for a "cheat input bar" - I'd assume that all you have to do is have a textField and every time a user enters a character into it, check to see if it is equal to a preset cheat code... then go from there.
This seems pretty obvious to me - so perhaps I'm missing your question. Hopefully someone else will be able to interpret your.... Nevermind.
cobrasniper555
April 28th, 2006, 10:13 PM
Haha, Battleman, nice. But he is right. Anyways...there are multiple ways you can do it. There are the functions, array models, if statements, and such. I'll be glad to put time and effort into helping you, but tell me the levels of this game you are making...as in what frames are they in? And then pick the type you would like to know.
Nich
April 29th, 2006, 01:28 PM
I suggest you look up input boxes in the flash help
InfestedDemon
April 29th, 2006, 02:53 PM
why not do like game then copy the same thing but with the cheat's effect on then they put a code to goto the cheat game frame
E.G
Menu - Setup - Game
Menu - Setup - Cheat code input - Game 2
In the end they will be the same game but with cheats enabled
EDIT: And for input do a blank text thing, box it then goto properties input and something in actionscript that makes it goto game 2's starting frame.
Joppe
April 29th, 2006, 04:20 PM
^Maybe becouse that would be totaly undynamical and buggy?
Lets say your game looks like this.
guy.onEnterFrame = function(){
if(Key.isDown(Key.LEFT)){
this._x -= 5;
}else{
if(Key.isDown(Key.RIGHT)){
this._x += 5;
}}
}
Then you would want to check if the cheats are activated.
speed = 5;
cheat1 = false;
guy.onEnterFrame = function(){
if(Key.isDown(Key.LEFT)){
this._x -= speed;
}else{
if(Key.isDown(Key.RIGHT)){
this._x += speed;
}}
if(Key.isDown(Key.ENTER)){
if(_root.cheat.text = "CHEAT1"){
cheat1 = true;
}
if(cheat1){
speed = 10
}
}
Or something like that.
Play with that ;)
Lord Rahl
May 1st, 2006, 09:15 AM
Its like joppe has shown, though there is one thing about the code. I am at class so I can't test joppe's code, but it defines the speed outside the clip event then inside it checks if the cheat is on and if it is, makes the speed 10. This works, but if you are adding a turn off feature remember that you have now changed your variable.
Joppe
May 1st, 2006, 01:32 PM
Yeah the code works, i tried it but, see its inside the clipEvent and therefor it turns the speed to 10 each frame, not the best way :sigh: but hey im not known for making good scripts processor wise
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.