Under rating threshold (hideshow)
This tutorial is so helpful i have the half of my game finished and it looks perfect.You should thank kongregate for this thing.
Under rating threshold (hideshow)
I suppose the instance name can make some problems if it has the same name as the class name. So you should name it not "ship" but something other. Also don't forget to change "_root.ship" to "_root.newInstanceName"
Under rating threshold (hideshow)
hey, can someone help me? Im having a problem in page 2. When i name the hero ship instance "ship", in the root timeline, it looses all of the functions and properties ive add in the past tutorials. Im using flash cs4, idk if thats the problem.. If anyone knows how to solve please pm(message) me or leave a comment. Also, sorry for the bad english, im not a native speaker. Thx =)
Under rating threshold (hideshow)
For all people who have problems with missiles that don't make enemie explode: after a week I finally solved it! You have to make sure that the name of your 'ship' is exactely filled in the codes, and it must be different from the class name. So I called it 'ShipInstance' and it only worked after I filled in this:
for(var i in _root.ShipInstance.enemies)
{
if(this.hitTest( _root.ShipInstance.enemies[i] ) )
{
this.removeMovieClip();
_root.ShipInstance.enemies[i].explode();
}
Under rating threshold (hideshow)
Here is a nice little feature I picked up from C++. put this in your ship class. if(_x>600) *new line* { *new line* _x=600 *new line* } Also include the same thing for x300. This will stop the hero ship from leaving the screen.
Under rating threshold (hideshow)
for the source files: right click and open in new window. then, when it appears , quickly press ctrl+a. it worked for me! (it was opening and closing before)
Under rating threshold (hideshow)
Only half of the enemies on-screen are being killed by my bullets- the rest of them, I can only kill by moving my hero into them. Does anybody know a fix?
Under rating threshold (hideshow)
Everyone who can only shoot half their enemy ships, listen up: You're not putting all the enemy ships in the enemy array. Many of us weren't careful when we copied and pasted the Shootorial code into the onEnter function, so now we have two independent ship launching codes. Basically, if you forget to delete a certain bit of code, half of the new enemy ships are not pushed into the array and so aren't affected by missiles. To correct this, look at the source ship.as and compare it to your code under the onEnter function, specifically the part that reads "if (enemyTimer..."
I deleted a line from my ship.as to match the source, and it works without a hitch now!
Under rating threshold (hideshow)
Neither Firefox nor Internet Explorer is allowing me to download the source files. Could somebody PM me a direct link?
Under rating threshold (hideshow)
This tutorial is lacking in its explanation of a for... in loop. How exactly does it work? I see it's in the onEnterFrame method so for each frame does it check the entire array?
Under rating threshold (hideshow)
step 9 causes a memory leak. each time we make the enemy array larger, the for loop that checks if your shots hit anything takes a little but larger. if you decided to expand the game with that code, you'll start to get massive slowdown as the array reaches the ten thousands or so. any chance someone reading this can help me write a splice function to keep the array size reasonable?
Under rating threshold (hideshow)
can someone tell me how to insert the explosion in cs5.5? cause when i try to open the Fla file it says "Unexpected file format"
Under rating threshold (hideshow)
I have searched through my code a million times, and cant find any reason why my explosion animation loops constantly when I destroy an enemy. I even tried importing the kongregate explosion file + code, to no effect, so the problem obviously doesnt lie with explosion.as file. PLEASE help, its the only major problem Ive encountered so far and am unable to figure this one out on my own, ive been stuck on it for two days!
Under rating threshold (hideshow)
When I wanted to import the .fla file into the Flash library, the Flash said: "One or more files were not imported because there were problems reading them." Also, nothing moves in the test movie. I have Flash CS 5.5, don't know if this is the problem.
Under rating threshold (hideshow)
Nevermind. Answer is yes. Kind of cheap that AS2 does that. I would expect more than a good old fashioned bounding box-style thing. Ah, well. It's still very useful.
Under rating threshold (hideshow)
i'm using flash cs5 and when i try to use the hitTest line it just returns an error saying that i cant use that code on a Class definition =( any solutions?
Under rating threshold (hideshow)
@ marx4400 I've read that it has something to do with the name of your instance. I just had that problem. If you name the instance the same name as the class nothing works. Problem I'm having now is I can't get my hit detection to work. Enemies are flying right through my ship :(
Under rating threshold (hideshow)
Right. None of the missiles were hitting the ships and disappearing but i managed to get the enemy missiles to disappear. Anyone got any suggestions concerning hero missiles as i can't find any problems with it. I'll keep trying. Thanks.
Under rating threshold (hideshow)
Hey guys, I have completed this game and its works perfectly. But when I try to use the same sort of code for another game the collision detection doesn't work. It only detects the first object enemy or object wall in the array and no other. Can please help me out? :D I start off stating the array.
Under rating threshold (hideshow)
For some reason, the enemy ships are exploding when I run into them, but not when my missiles hit them. If you have any idea why this is happening, then please send me a message. Thanks!
Under rating threshold (hideshow)
Where do u get the Explosion clip animation??????? I downloaded the source files and it was a WinRaR, what is the explosion thing called?? I cant find it in side the files
Under rating threshold (hideshow)
Fantastic tutorial , but may be there is one error : "right click on the explosion clip in the library and choose : Linkage" , I think "properties".
Under rating threshold (hideshow)
For ppl having trouble with page 2 and changing instance name, if ur layer Ship also then either rename the Ship something else or the layer. The reason its not working is because it's using the layer name "Ship" instead of the movie clip. I just change the instance name to something else and it works fine.
Under rating threshold (hideshow)
To everyone complaining about hitTest not working: make sure to define your explode function OUTSIDE of the onEnterFrame function. Should look like this. class EnemyShip extends MovieClip {
var speed;
function explode() {
this.removeMovieClip();
}
function onLoad() {
_x = 700;
_y = Math.random()*200+50;
speed = Math.random()*5+5;
}
function onEnterFrame() {
_x -= speed;
if (_x<=-100) {
this.removeMovieClip();
}
if (this.hitTest(_root.ship)) {
explode();
}
}
}
Under rating threshold (hideshow)
Same with Markonan here, the array puts me in error. And I don't think the instance name '_root.ship' is the problem. Actually, I found an error window right beside the timeline window, "There is no property with the name 'enemy'" it says. I have little idea what it means, can somebody help?
Under rating threshold (hideshow)
I feel like everytime i change something in my ship code everything stops working :( the ship doesn't move or shoot anymore and no enemies spawn or shoot or anything! I've been pawing over the code all day and nothing seems to be wrong with it... can someone help? pm me or something i beg of you! :p
Under rating threshold (hideshow)
i have this problem.. after i have added the collision between missile and enemy ship th rate of fire of hero ship change.. when the test begin it's only one missile but some enemy after it's 2 3 4.. any solution?
Under rating threshold (hideshow)
I get an error when I put the array into my code. When "enemies = [];" is put into my code the enemies stop spawning, bullets won't fire, and the background doesn't move like it's supposed to. I altered the gameplay slightly (ships coming from random locations, top to bottom, left to right, etc., bullets shooting all directions, and background moving with the ship instead of only horizontally) but no changes that I can think of that would alter it enough to do this. I tried it without the "enemies = [];" (and the "var enemies;" still created) and I don't have any problems whatsoever. I also tried it by doing "enemies = new Array();" but got the same issue. Any ideas?
Under rating threshold (hideshow)
.....don't know if this is a re post or if my internet is acting up.....
short version
i need help getting the full source code, or the whole original game file: which ever it was i had before my computer bsod-ed on me. i have all i need but no file to copy the explosion from to paste into my own.
all help is great thanks
-i did right click and download the source code from multiple pages but none have the file i need
Under rating threshold (hideshow)
for people having trouble getting their missiles to connect with other movie clips. Make sure that you are not typing enemy when you should be typing enemies and vice versa. Its easy to start getting them all confused,.