[ 5 posts ]  Reply to topicPost new topic 
Author Message
 [zz]
 Post subject: Need help with coding error.
PostPosted: Wed Dec 22, 2010 9:20 pm 
User avatar
Member
[*]
[*]
I am making a minigame, not related to Mario; and I have a problem, the point of the game is you're a laser and you change to the corresponding color of the enemy. The problem I'm having is: one color of the enemy still hurts you, even when you're the same color as it. I'm not sure where the coding error is so I would like someone to look over my script, I myself have looked over it numerous times and have narrowed it down to the following code but can't be sure, I tried changing a few things but no difference.

Code:

// Death
if (place_meeting(x,y,player) && player.image_index = 0 && blue = 0)
{
    instance_destroy();
}
if (place_meeting(x,y,player) && player.image_index = 1 && blue = 1)
{
    instance_destroy();
}
if (global.hits > 0 && place_meeting(x,y,player) && player.image_index = 0 && blue = 1)
{
    global.hits -= 1;
    instance_destroy();
}
if (global.hits > 0 && place_meeting(x,y,player) && player.image_index = 1 && blue = 0)
{
    global.hits -= 1;
    instance_destroy();
}


I've also included the .gmk in case anyone could look?
http://www.mediafire.com/?mxsz4atkdd03bb5

 
Top
Offline 
 
 
 [zz]
 Post subject: Re: Need help with coding error.
PostPosted: Wed Dec 22, 2010 11:58 pm 
User avatar
Member
I see your problem, pretty easy fix. I'll work on the gmk.

 
Top
Offline 
 
 
 [ca]
 Post subject: Re: Need help with coding error.
PostPosted: Thu Dec 23, 2010 12:14 am 
User avatar
Member
The problem is in the Create event of enemy_hola, near the bottom after //Set variables, blue = 0; should be deleted.

 
Top
Offline 
 User page at mfgg.net
 
 [zz]
 Post subject: Re: Need help with coding error.
PostPosted: Thu Dec 23, 2010 12:15 am 
User avatar
Member
Beat me to it! I was lookin' in another place, found it though.

 
Top
Offline 
 
 
 [zz]
 Post subject: Re: Need help with coding error.
PostPosted: Thu Dec 23, 2010 1:04 am 
User avatar
Member
[*]
[*]
Thanks so much guys I got no support at all from the places I asked. :D

 
Top
Offline 
 
 
« Previous topic | Next topic »
Display posts from previous:  Sort by  
 [ 5 posts ]  Reply to topicPost new topic 


Who is online

Users browsing this topic: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group