Messages from me to you and questions

Game Editor comments and discussion.

Re: Messages from me to you and questions

Postby lcl » Fri Nov 25, 2011 6:48 pm

SuperSonic wrote:Just one problem, if you press backspace when there is nothing in the name, the game crashes Don't know why sorry about that.

Well, look at the gogo's code.
Now, what is 0 - 1? It's - 1. Is there array cell - 1? NO!
It's important to remember to use safety checks. Like here, let's make it check if the current array position is greater than 0.
Code: Select all
for(k=0;k<255;k++)
{
    if(TD_String.text[k]==0)
    {
        TD_String.text[k - 1 * (k > 0)]=0;
        break;
    }
}

Now, the code does nothing if you're at the position 0. :)
I wonder why hadn't GaG thought of this..

Anyway, that's it. :)
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: Messages from me to you and questions

Postby Game A Gogo » Fri Nov 25, 2011 7:51 pm

probably because I made this code 3 years ago xD
I never really tested it that much either
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Messages from me to you and questions

Postby lcl » Fri Nov 25, 2011 7:58 pm

Game A Gogo wrote:probably because I made this code 3 years ago xD
I never really tested it that much either

Ah, I see :D
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: Messages from me to you and questions

Postby SuperSonic » Sat Nov 26, 2011 3:32 pm

Thanks for explaining that lcl :D
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Previous

Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest