Switching in-between game levels

I'm having problems trying to invoke my setMap method in my game canvas class. It works fine when I use it in my tile layer class after removing the default case in the switch statement, but for some reason, it doesn't switch the level in my game's thread. Could it be that I have to call the garbage collector, then the method, or will I have to create a seperate array that merges my current map with the next level? I've searched and asked everywhere and found absolutely nothing.
package de.enough.polish.example;
import javax.microedition.lcdui.game.*;
import javax.microedition.lcdui.*;
public class TheLevels {
    private static final int [][] level1={
    {0,0,0,0,0,0,0,9,10,0,0,0,0,0,0,0,0,0},
    {6,6,6,6,6,6,6,7,8,5,5,5,5,5,5,5,5,5},
    {1,1,1,1,1,1,2,3,3,4,1,1,1,1,1,1,1,1}
    private static final int [][] level2={
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
    {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
    {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}
    private int TILE_WIDTH=64;
    private int TILE_HEIGHT=64;
    private int TILE_NUM_ROW = 3;
    private int TILE_NUM_COL = 18;
    private int [][] currentLevel;
    private TiledLayer theBoard;
    private int screenHeight;
    private int bgColor;
    /** Creates a new instance of TheLevels */
    public TheLevels(int screenHeight) throws Exception {
        this.screenHeight = screenHeight;
        setMap(1);
    public void setMap(int level) throws Exception{
        Image tileImages = null;
        switch (level){
            case 1:  tileImages = Image.createImage("/street.png");
                      currentLevel = level1;
                      //groundColor = 0xF8DDBE;
                      break;
            case 2:  tileImages = Image.createImage("/grass.png");
                        currentLevel = level2;
            default: tileImages = Image.createImage("/street.png");
                      currentLevel = level1;
                      //groundColor = 0xF8DDBE;
                      break;
            theBoard = new TiledLayer(TILE_NUM_COL,TILE_NUM_ROW, tileImages, TILE_WIDTH, TILE_HEIGHT);
            for (int rows=0; rows<TILE_NUM_ROW; rows++) {
              for (int columns=0; columns<TILE_NUM_COL; columns++) {
                theBoard.setCell(columns,rows,currentLevel[rows][columns]);
        public TiledLayer getBackground(){
            return theBoard;
        public int getBackgroundColor() {
            return bgColor;
        public int getWidth(){
            return theBoard.getWidth();
        public int getHeight(){
            return theBoard.getHeight();
}

I would connect each device to a power source, and then reset them by holding the power button and the home button until they turn off.
If it keeps happening, I would put the devices in recovery mode and restore them with iTunes.
This article will help with that if needed:
iOS: Unable to update or restore
http://support.apple.com/kb/HT1808

Similar Messages

  • HT4623 after the ios 7.0 update my iphone 4s and ipad keep switching in between the home screen and the apple loading screen, can anybody help?

    Can anybody help with the above?
    i.e
    both my iphone 4s and ipad switch in between the home screen and the apple loading screen
    Many thanks

    I would connect each device to a power source, and then reset them by holding the power button and the home button until they turn off.
    If it keeps happening, I would put the devices in recovery mode and restore them with iTunes.
    This article will help with that if needed:
    iOS: Unable to update or restore
    http://support.apple.com/kb/HT1808

  • Why did the trace NOT show the other switches in between?

    I have a PC that is connected to a switch (A) in a network. Switch A has many switches in between and connects to another switch B. When I did a trace to the server, the last switch I see in the result is switch B. Also, when I checked to which port of switch B that the server was connected, It showed as Po1. When I did a show cdp neighbor for the interfaces for the interfaces involved inthe bundle, I get a switch and then another. Why did the trace NOT show the other switches in between? Why did I get an arp on Switch B? Could some one explain?

    It's hard to tell, but if you have L2 switches, the addresses on those L2 switches are for management purposes only and you won't see a response from a trace. The only time you'll see a response is when the packet is routed between devices and not switched. You'll get an arp request/response across a single vlan. If you have vlan 10 across 10 switches, all 10 switches will see an arp request because they're broadcasted throughout the whole vlan.
    HTH,
    John
    *** Please rate all useful posts ***

  • Shortcut for switching / tabbing between open documents?

    Hi. In Mac OS in general, you can switch between open documents or windows in the same program via the shortcut COMMANDO + >. Like for instance different windows in Firefox. But in Numbers and Pages, this means zoom in or out.
    Does anybody know a shortcut to switch / tab between the open documents in Numbers and Pages?
    I have searched google, here and e-mailed for help and found nothing.
    Thank you!

    Hello Jerry.
    There ARE keyboards like that:
    http://www.ergoblog.com/2006/09/keyboardwithe.html
    http://www.sspdirect.com/large-letter-keyboard.html
    You see, just google for "Large letter keyboard" and maybe add Mac. But ones without Mac symbols works just as fine, you just have to learn which key is which.
    Seems there is no solution to my tilde-problem...
    Thank you my french friend, for the understandning of the swedish problem
    Regards,
    Kip

  • Problem with switching tabs in top level navigation for Roles

    Hi,
    I've created two tabs (based on two roles) in the portal top level navigation menu. When clicking the first one it opens as it should. Then when clicking on the second tab it will not open, instead the first tab open up again, it sort of switches back automatically.These  two roles  are  basically consists of worksets and iviews(accessing to r/3).
    Does anyone have any expericene with this type of problem?
    please  suggest me
    Thanks
    Aravinda

    Hi Aravinda
    Please check this link
    Re: Problem with switching tabs in top level navigation
    Regards
    Geogi

  • Copy Query between Aggregation Levels

    We wish to copy input-ready queries between Aggregation Levels using NW2004s, however the old BW transaction RSZC to copy queries only appears to work for queries on InfoCubes or MultiProviders.
    Does anyone know if it is possible to copy queries between aggregation levels or do we need to manually recreate them each time?
    Cheers,
    R

    Hi RM,
    I have also been looking for this when setting up integrated planning.
    As far as I know, you have to manually recreate them.
    Please assign points if this solved your problem,
    Best Regards,
    Filip

  • How to save a game level ?.....................

    I have created a game level.....now i want to add a feature that user players can save the game at any levels....and they can load it later on................can anybody help me to achieve this......

    This question is not related to Java 2D, and is too general.
    Try rephrasing the question to a specific set of questions.

  • Difference Between "Client Level & Company Code Level"

    Hello
    Can any explain me the difference between client level and company code level?
    What is the configuration that we do on client level and company code level?

    Message: Dear,
    Client : Unit within SAP system, self-contained, separate master data with independent set of tables. It represent corporate group.
    Company Code : Smallest organizational unit of external account for which a complete, self-contained bookkeeping system can be replicated.
    e.g, company within a corporate group
    Note: You will do the configuration at company code level by logging into the client for master tables etc..

  • Differences between clint level vs company code level

    Dear Gurus,
    Can you please explain the difference between- client level vs company code level Vs coustmer master data level
    Thanks in Advance
    Bhaskar
    Please search the forums before posting queries.
    Respect forum rules.
    Edited by: Zubin Shah on May 14, 2010 3:29 PM

    Hi,
    Client Level
    The client is the highest level in the SAP System hierarchy. Data stored at client level can be accessed by all company code in the system.
    Company Code Level
    The company code is the central organizational unit of external accounting within the SAP System. Data stored or created at company code level can be used with in company code.
    Customer Master Data
    Customer Master data is divided into three parts:-
    Client Level
    Company Code Level
    Sales Area Level
    For Example:-
    Customer Master created at client level like address data can be used by all company code. If customer A master data has been maintained at client level than company code ABCD and company code EFGH can extent customer at company code level and use customer for FI posting. Again if you want to use customer for SD than you need to extent it in SD area.
    So, you can say that Master record created at client level can be used by all company code across the system.
    Regards,
    Anand Raichura

  • After installing lion, my computer switches constantly between dashboard and current screen

    I installed lion this morning and my screen switches rapidly between the dashboard and current screen, initially i thought it was my mouse, but after changing mouse I still get this issue and when my computer has been out of use for a while, i have to "erase" the screen to get to my login, any ideas?

    After restarting your computer, try booting into the "recovery HD" by holding down Option at startup and try re-installing Lion. I had the Same problem when I installed Lion but that fixed it.
    Rember: back up your data first through time machine so you can restore to the backup once you get Lion reinstalled.

  • HT2729 How do I switch movies between sd and hd on my computer

    How do I switch movies between SD and HD.

    System Preferences > Display > Arrangement
    Drag the white Menu bar from the main screen to the second screen.

  • Difference between rew level triggers and statement level triggers

    Hi All
    I would like to know the exact difference between rew level triggers and statement level triggers.Please provide me with an example.
    Thanks
    Anand

    What is difference between row & statement?
    One statement can change many rows.
    Difference determines how many times the trigger fires or under what conditions.

  • Z10 getting switch of after battery level 40%

    I was purchase z10 before 20 days now my handset is giving problem that it get switch off automatic when battery level is 40% and if I will take out battery and trying to switch on again it is not working.then I have to put charger for 2 min then it's get on but how come mobile getting switch off on 40% level.<br>Plz let me know what to do.<br>

    I faced the problem too...
    You should try this... whenever your phone gets switched off at 40% try to keep the out of your phone for an hour then your battery charges from 0%..
    I've tried this it worked out for ma phone..!!!

  • DIFFERENCE BETWEEN SINGLE LEVEL AND MULTI LEVEL COSTING

    Sir,'
    Please explain the difference between Single Level and Multi Level Costing in Detail
    thanking You

    While using material ledger, we can use the single level or multi-level price determination for valuation of inventory.
    Procurement processes are used in Product Cost Controlling to determine procurement costs and to present those costs. Purchase Order, for example, is single-level procurement and Production is multilevel procurement.
    Single-level material price determination calculates the periodic unit price for a material. The standard price and the cumulative single-level differences of the period are taken into account. Single-level material price determination takes into account the differences that arise directly when a material is procured.
    Multilevel price determination calculates the periodic unit price for a material. The standard price, the single-level differences cumulated in the period, the differences between planned and actual prices, as well as input material differences (multilevel differences) are all taken into account.
    Single-level material price determination  is a prerequisite for Multi-level price determination.

  • Difference between system level privilege and object level privilege

    hi
    i just want to know the difference between system level privileges and object level privilege.
    please correct me if i am wrong
    with system level privilege user can create objects such as creating tables,view,synonyms etc
    where as in object privilege we can only manipulate operations on object i.e perform dml not ddl
    please help

    Hi,
    810345 wrote:
    hi
    i just want to know the difference between system level privileges and object level privilege.
    please correct me if i am wrong
    with system level privilege user can create objects such as creating tables,view,synonyms etc
    where as in object privilege we can only manipulate operations on object i.e perform dml not ddl There are some system privileges that only concern manipulating objects: SELECT ANY TABLE, for example.
    The main difference is that the system-level privileges tend to cover all objects of a certain type, including objects that haven't been created yet.
    Object-level privileges usually apply only to one specifi object, such as one particular table, and are lost if the object is dropped. (For example, if I create a table called table_x, give you SELECT pivileges on it, then you can query my table. But if I then drop table_x and re-create it, you will not be able to see it unless I grant the privilege again.)

Maybe you are looking for

  • List of Discount based on customer

    Olá pessoal, Sou novo no mundo SAP SD e estou com algumas dúvidas... vou postar uma das principais aqui... Na empresa em que trabalho, o processo funciona da seguinte forma: 1. Cliente é cadastrado 2. Ordem de venda (OV) implantada para este cliente

  • Enterprise development for iPad

    Hi guys! Please give me understanding on some issues. We want to develop corporate applications for private users, not for the Internet. And we want to let our Flex apps to work on iPad. Is it possible? 1. Apple requires development of apps only on C

  • How do you use the JSObject class?

    Hello everyone, So, I am trying to make a java applet call a java script function and I am having some problems.... I began by looking at the JSObject class.... Does the JSObject class come standard with an installation of java? or do I have to find

  • How can I add audio files manually to my iphone when iTunes match is turned on?

    I use iTunes match, and after resolving the debacle after updating to iOS 6 listed here: https://discussions.apple.com/message/19623582#19623582 it seems to be working fine. My problem is as follows: I have a series of audio files (lecture recordings

  • Windows 7 x64 USB AUDIO DEVICE - Device Not Working - Mac Pro

    I have a mac pro early 2009. I had vista x64 installed, everything was great. I had 2 audio devices under device manager, one was listed as HD (digital) and one device was listed as analog audio. When I played games and wanted the external speakers (