Monster Racer Rush
Select between 5 monster racers, upgrade your monster skill and win the competition!
4.18 / 5.00 3,534 ViewsBuild and Base
Build most powerful forces, unleash hordes of monster and control your soldiers!
3.80 / 5.00 4,200 ViewsAt 2/3/12 10:45 AM, Version2 wrote:
I said in my second post that I stopped using static in that function.
err... rather I subtly implied it. But no, it's not being used anymore.
At 2/3/12 09:41 AM, Diki wrote:
milchreis is right. You don't know what static means and you need to stop using it.
I said in my second post that I stopped using static in that function. I'm still getting errors when I try to use that function, as I explained in my second post. Static isn't being used anywhere in my code anymore, however I still can't access my screen handler from any class outside of Main for some reason.
Well, the reason it was static was because when I called the function from a different class I would get an error 1061: Call to a possibly undefined method getScrnHand through a reference with static type Class.
that error gets thrown when this runs and getScrnHand() isn't static:
private function endScreen(e:Event):void
{
Main.getScrnHand().createScreen("GameScreen");
Main.getScrnHand().showNextScreen();
}
I started working again on one of my older projects and ran into a error that shouldn't be happening. I'm getting an undefined property (error 1120) on something that has been clearly defined in the first few lines of code.
The variable "scrnHand" says it's undefined when I try to run the program. However you can clearly see that I make it into a new ScreenHandler almost first thing. Here is the code:
public var scrnHand:ScreenHandler;
public var scrnHolder:Sprite
public var startScreen:String
public function Main()
{
scrnHolder = new Sprite();
addChild(scrnHolder);
scrnHand = new ScreenHandler(scrnHolder); //defining scrnHand here?
compileScreens();
firstScreen();
addEventListener(Event.ENTER_FRAME, updater);
}
But where I get the error is here in this section:
public static function getScrnHand():ScreenHandler
{
return scrnHand; //error 1120, scrnHand is undefined?
}
Even if I change it so nothing calls getScrnHand() it still throws the error first thing, I don't even get my traces in the output window, just error 1120. Does anyone have an idea why it's saying scrnHand is undefined on that line?
At 8/4/11 01:29 AM, MintPaw wrote: Well that's going to be annoying with like 20 combos.
Nah, just use a multi-dimensional array to store your combos, then loop through that. Some pseudocode off the top of my head on what it might look like:
var comboArr:Array = [[1, 2, 3], [2, 1, 3], [3, 2, 1]]
var comboToCheck:Array;
for each(var combo:Array in comboArr){
for(var i = 0; i < combo.length; i++){
if (comboToCheck[i] != combo[i]){
//do your check here
//if combo matches, save it and execute after loops or something
At 8/3/11 05:57 PM, PSvils wrote:
:Could you maybe make one like that pleaz?
It's called FlashDevelop.
... still not sure if serious
At 7/28/11 03:40 PM, Yannickl88 wrote:At 7/27/11 04:34 AM, Version2 wrote: Hmm... I think I might be doing it wrong. My code is this:I think you still need to inport it. Easiest way is to just add
...
import package.where.classes.are.from.*
.
I actually ended up solving the problem, and your solution was close. Importing the package wasn't enough, I needed to reference the classes specifically, so I just made this function:
private function compileScreens():void
{
MainMenu;
GameScreen;
}
It's not pretty, but I kind of like it though, because it's a nice list in my main class of all the screens used in the game.
As interesting as this all is, can we all please remember this is a Flash/AS3 help.
HAROfficial, awesome post. Thanks for sharing your links with everyone.
Hmm... I think I might be doing it wrong. My code is this:
public function createScreen(_nxScreen:String):void
{
var myClass:Class = getDefinitionByName(_nxScreen) as Class;
nextScreen = new myClass(showScreen);
nextScreen.start();
}
I end up with this error however:
ReferenceError: Error #1065: Variable MainMenu is not defined.
at global/flash.utils::getDefinitionByName()
at ScreenHandler/createScreen()[C:\Users\Mr. Blue Dot\Documents\projects\Flash Projects\ZombieGame2\ScreenHandler.as:24]
at Main/firstScreen()[C:\Users\Mr. Blue Dot\Documents\projects\Flash Projects\ZombieGame2\Main.as:31]
at Main()[C:\Users\Mr. Blue Dot\Documents\projects\Flash Projects\ZombieGame2\Main.as:25]
Cannot display source code at this location.
Any ideas? I'm googling the error number now to see possible causes and fixes.
Thanks MintPaw, I'm trying that out now.
I want to tell a ScreenHandler object to create a new main menu so I use:
var classToCreate: String = "MainMenu";
var scrnHandler:ScreenHandler = new ScreenHandler();
scrnHandler.createScreen(classToCreate);
Then in ScreenHandler I need to do something with the string like this:
public function createScreen(createThis:String):void
{
myObj = new (createThis as a class); // this is the part I need help with
}
Hopefully you can see what I'm trying to do here. The string that gets passed in is the name of another class/ .as file in the project, so myObj in this case is supposed to be a new MainMenu.as. How can I change the string createThis into "new MainMenu"?
Thanks in advance, something tells me it's a real simple solution that I will make me feel like an idiot for asking :)
At 6/10/11 09:54 PM, Stereocrisis wrote:And don't say for me to just type the story and go back later, because that would take way too much time to go back and insert a name every other line. I want this problem fixed for me, that way I don't have to do that.
Most word processors have a Find and Replace tool, it really doesn't take that long.
I pretty much start off with place holder names, something I pick in five minutes so I can just get on with the story itself. Most of the time those names stick, sometimes they don't. If I think of something better I just use Find and Replace. It can get tricky with nicknames occasionally, but that gets ironed out when I do my rewrites.
At 6/3/11 04:24 PM, TurkeyOnAStick wrote: Marked as a sketch. You can normally spot this if you're unable to vote on your work.
I've just fixed it and you can spot it ... here.
Awesome! Thanks Turkey :)
I like that last one a lot. It's almost like if Tron did plaid, but in an awesome way :)
Grrr... So I submitted a piece to the art portal a while ago, and it never appeared in the portal at all, in either the scouted or unscouted sections. Does anyone know why that happened?
Oh, and the piece is here: 4D Worm God
Hopefully someone can help me out with this. I have a photo of my subject, that's lit with normal 3 point lighting from the front, but what I'm trying to do is make it look like there is a very bright light behind him instead (pretty much he's standing going to be standing in front of an "explosion" of light). I know how it should look, mostly shadow in front with reflected light on the edges/sides of the subject, but what I've been trying hasn't been working to well (manually painting in the shadows).
Does anyone know a better way to try this effect? Painting hasn't been going so well since my tablet broke and I'm left with only my laptops touch pad. I've been looking for tutorials for this or a similar effect, but apparently a lot of people think that backlighting means putting a white gradient circle behind a photo (which is just retarded, thanks internet...).
For reference, what I'm going for is somewhere between this picture of horses (good back light, but almost no side lighting) and this picture (a little too much side light on the left side)
At 3/27/11 07:06 PM, VaginaBoob wrote:
:I already plan on getting it published but I thought I'd give my favorite website a sneak peak.
Eek, but then you posted it here. Pretty much what you have done is just self published your story, which can really hurt your chances of another publisher taking this.
If you have a story you feel can be sold/published/whatever then DON'T post it to a public website. Excerpts are usually OK, but once a full story is out on the net, you can't take it back (especially on a site like this where users can't delete their own posts).
I haven't read the story yet, I apologize, I only stopped in quickly while having lunch. I'll try to read it later tonight. But I thought I should say something about publishing real quick. Sorry if this isn't exactly helpful to you.
At 3/22/11 12:58 PM, Johnkirk wrote: Thanks for providing some scale in terms of the mining equipment. I really don't know much about the more advanced pieces of equipment and them being that big. I will revise those descriptions.
Glad I could help :)
I know it sucks, but sometimes research is the difference between a good story and a great story. I've spent the last two weeks reading everything I can find about the solar system past Neptune's orbit, and asteroid mining. It's a lot to absorb, but it's making my story much better.
Do a quick google search, mining is actually a lot more interesting than it sounds, lol. Big machines makin' big holes, humanity at it's finest right there :)
I read as much of it as I could. The narrator addressing the reader is really annoying, and honestly the narrator is full of himself. There's a lot of grammar errors through out, and the formatting is terrible, especially considering its on your own blog. If it was on NG, I might look past it, but on your own site? There is no excuse to make it into a huge wall of text.
I'm not saying you don't have any talent, don't take it that way. I'm just saying that this isn't a good story in my opinion.
At 3/23/11 07:25 PM, Coop wrote: I'm not sure I agree with that - by the time I have spent 10,000 hours playing cricket, that's over a solid year of playing. 52 weekend cricket matches, which is about 3-4 years of cricket seasons, including the practice and the Wednesday night leagues. I'm still not really that good.
It's more of just a general rule of thumb, and I've really only seen it when it relates to more cerebral activities. I'm not sure that it relates all that well to sports and physical activities because of all the variables your body introduces (general fitness and health, age, injuries, ect.).
But the thing I think everyone forgets when talking about the 10,000 hour (or million word) rule is, that's about how long it will take to become an expert. It doesn't take that long to become proficient at something. If you're aiming to become an expert, then yeah, study, and write until you know everything there is to know about writing. But if you're just writing just as a hobby, don't worry about it. Get to where you're comfortable, then just have fun.
At 3/23/11 06:20 AM, VGamer21 wrote: The whole point of the prologue is to not understand it until later in the book.
Um... no. That's the point of a bad prologue, like I said. Remember when I said don't have a prologue just for the sake of having a prologue?
All you're doing is trying to be mysterious, and at this point in the story, the reader can care less. The reader doesn't know who these people are, and by the time he gets done with the first paragraph of the book he's going to have forgotten all about the prologue you wrote. There's nothing memorable there, there are no important details that you won't end up explaining later on anyway. I haven't even read the rest of your story, and already I know that your prologue is completely skippable.
Also, these guys have names, I just didn't use them because it didn't make sense
I didn't say use their names, I said you kept saying the word "man" over and over again, and it was repetitive. Learn to friggin' read.
I don't really know what you expected when you posted this on NG, but I'm not going to tell you it's good, when frankly, it's not.
At 3/22/11 06:34 PM, VGamer21 wrote: He had his legs crossed, right over left.
It's kind of unnecessary to tell the reader which leg was up and which was down. Most readers have legs, they can figure out what someone sitting cross legged looks like without all the details.
"...and how did the search go?" the masked man asked, breaking the silence that loomed overhead.
"The old man is being interrogated as we speak," said the hooded man. His voice was low and gruff. His tone seemed to possess a hidden anger.
So the three characters now are old man, masked man, and hooded man. I realize you are trying to be mysterious here, but this is really repetitive. Man, in this short post you use the word man 16 times, man! I'm not saying name them, but maybe instead of "(something) man" it could be noble, or assassin, or whatever is fitting for your story.
"Then has he told you where it is?"
"Yes," the hooded man replied. The masked man's grip loosened. The hooded man continued.
Oh! Good deal, he knows where the book is! Great job! This will be over quickly then!
"He says that it is in a place where no one will ever find it."
Wait... so you don't know? Why the hell did you just tell me you did? Liar!!
There's not really much to say about this. It's a prologue, it's short, and I know nothing about the world these people are in. I understand this book, and the gate key are important, but you're probably going to say a lot more about them in the story proper. Right now, the prologue is just vague and doesn't really tell me anything.
Prologues are tricky. They are often considered to be the "throw away" section of the book because they are either infodumps only there to bring the reader up to speed, or they are like yours and try to create mystery and suspense before the reader has any reason to care about what's happening. I'm not saying that all prologues are bad, there are many books with good ones. I'm just saying it's easy to write a prologue that is completely forgettable and ultimately unnecessary to the story. So make sure you have a prologue for the right reasons, and not just for the sake of having one.
Sorry for the double post, but there was one more thing I wanted to say:
"It's good to met you Doctor."
"Thank you Doctor."
"I understand Dr. Rodgers."
"Well Dr. Rodgers"
"Well... Doctor... there are a number of different types of SAMs."
"The final robot we have doctor"
"What does the Foreman do exactly Doctor?"
"Very impressive doctor."
"Yes Dr. The foreman can actually run the entire operation"
"So Dr. Zilimani, what is the problem"
STOP THAT! These characters have names don't they? She introduces herself as Rachel, and I assume Rodgers has a first name.
Also: "So the foreman was taken offline, I presume? A rock collapse that disabled the foreman could in theory disrupt the entire operation."
This is one really good reason for the foreman NOT to do the repairs. If the foreman is so vital to the operation that the whole thing crashes to a halt if it goes down, then you certainly wouldn't want to put it where it could come to harm.
Why do you start a new thread for each one of these? Just keep them all in one thread please.
So, there are a few things that are bugging me about this piece. First and foremost, calling people Doctors, and not saying what they studied in. So Dr. Rodgers has been called in for his expertise... No duh! He has a doctorate, of course he's an expert at something! It's almost as if you are just calling people doctors so the reader will know the character is smart. At this point in the story Dr. Rodgers hasn't really shown a level of intelligence greater than that of an average blogger. That's a big no-no as far as I'm concerned. Make your characters smart, don't just label them as such.
About the journal entry, I realize formatting is limited in the forums, so I'm not going to say too much, however I was confused at first as to when he stopped writing, and the narrative began. I didn't see the quote marks around the journal entry until I scrolled back up and read the entry again. Again, not a big deal, but something to think about if you post more parts of your story that have journal entries like this one.
Towards the middle of the excerpt Dr. Zilimani tells Dr. Rodgers that the SAM is in the next room, yet a few sentences later they are in an elevator, presumably traveling a good distance since she's showing him video of the robots in the mines, and they are having a long conversation. That isn't really so much "in the next room" so much as it is "right this way."
Now, about the mining equipment. I'm also writing a story that deals with miners. I'm going to attach a picture to this post to help you think about those seven foot tall automated mining drills a bit more. First, seven foot tall is tiny, I don't care if it has lasers or not. The miners I'm writing about use drill bits twice the size of your bot, and they're on objects past Pluto deep in the Kuiper Belt. The drill in the picture below is used at a potash mine in Canada. Those marks on the ceiling are from the drill, so this thing isn't even fully extended. To get to the point, drills are HUGE. This dinky thing you wrote about is a matchbox toy, no offense.
I also don't see the need for the "carriers" to be humanoid. Really, a bucket on an ATV would be good enough, and could carry more than something with arms. I guess the carriers could be pushing carts, but then why not just motorize the carts? You have to understand with robots that humanoid does not always equal better for the job than humans. Bipedal travel is very difficult, and not as fast, efficient, or stable as basic wheeled locomotion. You go to great lengths to tell the reader that these are the most advanced mining machines on the planet, however they clearly aren't designed for mining, which is a problem.
The foreman is ok as a Humanoid I guess, I really have nothing to say about his general design. So let's talk instead about how this one robot is the only one doing maintenance. There is a lot of equipment in a mine, this robot might be superhuman, but it's a single robot and can't be in two places at once. Most mining operations have maintenance teams to keep up with it all. It's not just when a machine breaks down that it needs repairing, you have to do regular maintenance to a lot of that stuff too, checking the oil, hydraulics, pumping tires, ect. This is more of a job for the humanoid carriers because there's a lot of them.
I say make your carriers into the maintenance crew, have automated carts take over the position of the carriers, and pump your mining drills full of steroids.
It looks interesting, I would like to see where you go with this, but there is room for improvement as well. And just so we're clear, I'm not trying to be mean or anything, these are just my opinions, so take them or leave them as you will. Hope you find something useful in this ramble ;)
At 3/20/11 05:56 PM, lightrail wrote: When I first played it I wanted to hold down the space bar.
Ditto, same thing here. Other than that the controls are fine.
Double check your keycodes first, I use this site's app when I'm setting up keyboard commands. If that doesn't work, post the code that isn't working, and you'll get a more detailed answer.
At 3/17/11 05:50 AM, DeathByStarfish wrote: now my file is 20 mb.
Are you talking about your .fla, or your .swf file? What really matters is the size of your .swf, as that's what you'll upload to sites. Just so long your .swf isn't huge, you'll be fine.
Other than that, ditto what everyone else says, use save and compact to make your .fla smaller.
At 3/18/11 08:55 AM, sanjeev98 wrote: No, he didn't.
Do you need glasses? There isn't a comma between the parameters in the code OP posted. So... yes, he did forget it. And it needs to be there or hes going to get an incorrect number of arguments error. _root, on the other hand, is not necessary to use getURL().
NGpulp: You may want to take a look at this blog post: factornine.wordpress.com/2008/09/10/getu rl-not-working-in-as2/
A relevant quote from the post: "I figured out that when the html and the swf are on separate servers, the getURL must specify "_blank" as the target."
And this is from the actionscript dictionary, as a reminder of what does what:
"_self" specifies the current frame in the current window.
"_blank" specifies a new window.
"_parent" specifies the parent of the current frame.
"_top" specifies the top-level frame in the current window.
At 3/18/11 07:20 AM, NGPulp wrote: onRelease = function() {
getURL("URL" "_self");
};
looks like you forgot a comma.
getURL("URL" , "_self");