The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.39 / 5.00 38,635 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.09 / 5.00 15,161 ViewsI've come across a problem whilst developing my new game. For some reason I can't get the bullets to interact with the enemy on the stage. Basically I want the enemy movieclip to play the next frame upon hitting in the bullet movieclip which is shot from the player. I cant think what's wrong in my coding or whether it is an issue with instance names.
Here is a link to the .fla I am using if anyone has the time to have a look and let me know what I need to change in order for it to work.
Arrow keys to move the red square and spacebar to shoot. The enemy is the black box.
Use SpamTheWeb to post Flash Files. Its ad-free and easier for people like me to figure out which download button is the right one. Plus no sign-up required.
At 7/17/10 11:16 AM, kylelyk wrote: Use SpamTheWeb to post Flash Files. Its ad-free and easier for people like me to figure out which download button is the right one. Plus no sign-up required.
Why not use your newgrounds dump?
Balderdash and PoppyClock
At 7/17/10 11:16 AM, kylelyk wrote: Use SpamTheWeb to post Flash Files. Its ad-free and easier for people like me to figure out which download button is the right one. Plus no sign-up required.
At 7/17/10 11:18 AM, Pork wrote:At 7/17/10 11:16 AM, kylelyk wrote: Use SpamTheWeb to post Flash Files. Its ad-free and easier for people like me to figure out which download button is the right one. Plus no sign-up required.Thanks! Much better link here :)
Bah, gotta use cs5 for this one. >.<
So first of all it looks like you have:
onClipEvent(load){
if (this.hitTest(_root.bullet[i]))
{
this.gotoAndStop(2);
}
}
1. This is a load event. It's only checking for collision. Put it at enterframe
2. What is this "i" variable it's never defined or set. Use a loop.
Was going to post a fix example but then I saw:
this._y -= bulletspeed;
if (this._y < -1 * this._height) {
this.removeMovieClip();
}
On you player. -_-
Meaning that your obviously copy/pasting this, and doing it incorrectly at that. Go out and lean this stuff or you'll never be any good.
Ok then I've made some changes to the coding... I still can't figure out how to get the enemy to interact with the bullets.
Instead of creating random numbers for the bullets I've done the obvious thing and included "i++" which just increases every time. I assumed I could use the same piece of coding that created the bullet to destroy the enemy. Hmmm