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 Viewsme and my friends are creating a game that is kinda like Raiden fighters, and 1942 we have the planes, stage and the fire button to work but my friend is having a hard time with the collision detection and we been trying to figure it out but we are not having any luck with it so if somebody can explain what we are doing wrong or help us out little bit it would be greatly appreciated
how could we possibly know what your doing wrong?
here's the code
var bullets:Number = 500;
var missiles:Number = 15;
var lives:Number = 3;
var cTime:Number = 0;
var cLimit:Number = 5;
var shootAllow:Boolean = false;
onEnterFrame = function(){
speed = 10;
if (Key.isDown(Key.DOWN) && Key.isDown(Key.LEFT)){
_root.player._x -= speed;
_root.player._y += speed;
if (_root.player._y >= 658) {
_root.player._y -= speed;
}
if (_root.player._x <= 30) {
_root.player._x += speed;
}
}
else if (Key.isDown(Key.DOWN) && Key.isDown(Key.RIGHT)){
_root.player._x += speed;
_root.player._y += speed;
if (_root.player._y >= 658) {
_root.player._y -= speed;
}
if (_root.player._x >= 270) {
_root.player._x -= speed;
}
}
else if (Key.isDown(Key.UP) && Key.isDown(Key.RIGHT)){
_root.player._x += speed;
_root.player._y -= speed;
if (_root.player._y <= 0) {
_root.player._y += speed;
}
if (_root.player._x >= 270) {
_root.player._x -= speed;
}
}
else if (Key.isDown(Key.UP) && Key.isDown(Key.LEFT)){
_root.player._x -= speed;
_root.player._y -= speed;
if (_root.player._y <= 0) {
_root.player._y += speed;
}
if (_root.player._x <= 30) {
_root.player._x += speed;
}
}
else if (Key.isDown(Key.RIGHT)){
_root.player._x += speed;
if (_root.player._x >= 270) {
_root.player._x -= speed;
}
}
else if (Key.isDown(Key.LEFT)){
_root.player._x -= speed;
if (_root.player._x <= 30) {
_root.player._x += speed;
}
}
else if (Key.isDown(Key.UP)){
_root.player._y -= speed;
if (_root.player._y <= 0) {
_root.player._y += speed;
}
}
else if (Key.isDown(Key.DOWN)){
_root.player._y += speed;
if (_root.player._y >= 658) {
_root.player._y -= speed;
}
}
if (Key.isDown(Key.SPACE) && shootAllow){
var bulletID:Number = Math.random();
_root.attachMovie('mcBullet', 'Bullet'+bulletID,_root.getNextHighestDe pth());
_root['Bullet'+bulletID]._x = player._x + player._width/60;
_root['Bullet'+bulletID]._y = player._y - 35;
_root['Bullet'+bulletID].onEnterFrame = function(){
this._y -= 20;
if(this._y < -1 * this._height){
this.removeMovieClip();
}
}
shootAllow = false;
}
cTime ++;
if(cTime == cLimit){
shootAllow = true;
cTime = 0;
}
if(mcFighter.hitTest(['Bullet'+bulletID]
)) {
trace("Hit");
mcFighter.removeMovieClip();
}
}