Alright, took a bit of work but I managed to make the following attachment. The only problem is when you die. When the zombie touchs your characters hitpoint the game goes to the ending frame/scene. Now no matter what I put it in, frame, scene, etc. It always does this. When you die the main char and enemy mc stay on screen and even when you hit restart. Try the swf to see what I mean.
post your code, probably a depth issue affecting remove movieclip
yep, most likely…
Another issue: Restart isn’t coming up, it came up the first time and then I closed the window and now the restard is gone. Post your code and I’ll take a look at it.
EDIT: Whoop, it just takes a second to come up. Must have missed it the first time, my bad.
we need to see your code, or at least the death part of code
Weird… Works fine for me.
why not try unloadMovie method?
onClipEvent(unload){
unloadMovie(_root.player)
unloadMovie(_root.zombie1)
unloadMovie(_root.zombie2)
}
Sorry for late post. Was feeling kinda ill earlier after my class. Here is the code for the enemy.
//Enemy movement
onClipEvent(enterFrame){
if(this.hitTest(_root.view)){
if(this._x>_root.mainchar._x){
this._x-=5;
}else if(this._x<_root.mainchar._x){
this._x+=5;
}
if(this._y>_root.mainchar._y){
this._y-=5;
}else if(this._y<_root.mainchar._y){
this._y+=5;
}
}
}
//Depth preception
onClipEvent(enterFrame){
if(this._y<_root.mainchar._y){
_root.mainchar.swapDepths(_root.getNextHighestDepth());
_root.setMask(_root.view);
}else if(this._y>_root.mainchar._y){
this.swapDepths(_root.getNextHighestDepth());
_root.setMask(_root.view);
}
}
//Kill Player
//onClipEvent(enterFrame){
//if(_root.mainchar.hitpoint.hitTest(this.hitpoint)){
//_root.gotoAndPlay("one");
//}
//}
The last part is the way it is because I am about to add a random function to go to multiple death scenes. Tho it works the way it should when you remove the //.
The following is the code for my main character.
//Standing/Walking controls/movement
onClipEvent(load){
dir="downstand"
}
onClipEvent(enterFrame){
if(Key.isDown(Key.UP)){
dir="upstand"
this._y-=8;
}
if(Key.isDown(Key.DOWN)){
dir="downstand"
this._y+=8;
}
if(Key.isDown(Key.LEFT)){
dir="leftstand"
this._x-=8;
}
if(Key.isDown(Key.RIGHT)){
dir="rightstand"
this._x+=8;
}
}
onClipEvent(enterFrame){
if(Key.isDown(Key.UP)){
this.gotoAndStop("upwalk");
}else if(Key.isDown(Key.DOWN)){
this.gotoAndStop("downwalk");
}else if(Key.isDown(Key.RIGHT)){
this.gotoAndStop("rightwalk");
}else if(Key.isDown(Key.LEFT)){
this.gotoAndStop("leftwalk");
}else{
this.gotoAndStop(dir);
}
}
And I do have a small code in the view mask.
onClipEvent(enterFrame){
if(Key.isDown(Key.UP)){
this._y-=8;
}
if(Key.isDown(Key.DOWN)){
this._y+=8;
}
if(Key.isDown(Key.LEFT)){
this._x-=8;
}
if(Key.isDown(Key.RIGHT)){
this._x+=8;
}
}
EDIT: Oh and for those who have not noticed whats wrong. When you go to the death frame, the main char and zombie MC’s are still there, and it will continue to try and gotoAndPlay('dead") untill you move him off the zombie. Then the death frame will continue to play and reveal the restart button.
Sigh I’v gone through my code and checked everything and can’t seem to find what may be causing the characters to stay on screen. Could it something else?
hope this helps
onClipEvent (load)
{
dir = “downstand”;
}
onClipEvent (enterFrame)
{
if (Key.isDown(38))
{
dir = “upstand”;
this._y = this._y - 8;
this.gotoAndStop(“upwalk”);
}
if (Key.isDown(40))
{ this.gotoAndStop(“downwalk”);
dir = “downstand”;
this._y = this._y + 8;
}
if (Key.isDown(37))
{
dir = “leftstand”;
this._x = this._x - 8;
this.gotoAndStop(“leftwalk”);
}
if (Key.isDown(39))
{ this.gotoAndStop(“rightwalk”);
dir = “rightstand”;
this._x = this._x + 8;
}
}
onClipEvent (enterFrame)
{
this.gotoAndStop(dir);
}
try merging both of them.I had the same problem once.