Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

878148 Posts in 32909 Topics- by 24328 Members - Latest Member: Pl4n3

May 21, 2013, 09:16:42 AM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)GM N00B Question
Pages: 1 [2]
Print
Author Topic: GM N00B Question  (Read 1066 times)
Calum Bowen
Level 3
***



View Profile WWW Email
« Reply #15 on: August 02, 2012, 12:12:15 PM »

OK! Next problem:

When the slug gets hit with rain it goes red (separate sprite - sSlugScream) so i'm

Code:
if(place_meeting(x,y,oDrop))

{
sprite_index=sSlugScream;
}

if (sprite_index=sSlugScream)
{
if (timer<timer_max)
{
timer+=1;
}
else
{
sprite_index=sSlugR
}           

For some reason, it only goes red once. The following times it gets hit it doesn't change to sSlugScream anymore just stays normal.
Does anyone know why it's doing this?
Logged

Sean A.
Level 7
**



View Profile Email
« Reply #16 on: August 02, 2012, 12:43:09 PM »

You are missing a closing curly brace, that could be part of it. Also code is easier to read when tabbed
Logged
Glyph
Level 6
*


Your ad here


View Profile
« Reply #17 on: August 02, 2012, 12:57:34 PM »

It needs to reset that timer each time, I'd assume - after saying 'sprite_index=sSlugScream;', add a line with 'timer=0' or whatever. Also, yeah, the closing bracket.
Logged

Feel visible matter...
Feel invisible matter...
There is life everywhere...
Calum Bowen
Level 3
***



View Profile WWW Email
« Reply #18 on: August 04, 2012, 01:49:36 PM »

Thanks guys - that fixed it!

The bracket thing was my failure to copy the whole of the code - it's in there.

onwards and upwards until the next problem arises. : )
Logged

Pages: 1 [2]
Print
Jump to:  

Theme orange-lt created by panic