
-----------------------------------
Prince Pwn
Mon May 28, 2007 10:33 am

Converting Int to Char
-----------------------------------
I need to convert an Integer into a Character so I could use a for loop to assign a number to a variable when I press a 1 2 3 or 4. For some reason it isn't reading the for loop input.

I'm basically needing a way to automate:

            if (key == '1')
                amount = 1;
            else if (key == '2')
                amount = 2;
            else if (key == '3')
                amount = 3;
            else if (key == '4')
                amount = 4;


Here is my code:

    public boolean keyDown (Event moving, int key)
    {

        if (introScreen)
        {
            if (key == Event.ESCAPE)
                System.exit (0);
            if (key == Event.RIGHT)
                amount++; // WORKS!
            else if (key == Event.LEFT)
                amount--; // WORKS!

            for (int i = 1 ; i 