Ignore:
Timestamp:
2015-06-24 15:14:15 (8 years ago)
Author:
anlakane
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2014/30/MitjaK/Attack to Agora/Attack to Agora/Attack to Agora/Attack to Agora/Attack_to_Agora.cs

    r6249 r6272  
    2424    PlatformCharacter taistelija; 
    2525 
    26     int kenttaNro = 1; 
     26    int kenttaNro = 2; 
    2727 
    2828    /// <summary> 
    2929    /// Viimeisen pelissä olevan kentän indeksi. 
    3030    /// </summary> 
    31     const int VIIMEINEN_KENTTA = 9; 
     31    const int VIIMEINEN_KENTTA = 15; 
    3232 
    3333    public override void Begin() 
     
    192192    } 
    193193 
     194    void LuoChromaCase() 
     195    { 
     196        Mouse.IsCursorVisible = true; 
     197 
     198        List<GameObject> pItems = new List<GameObject>(); 
     199 
     200        for (int i = 0; i < 40; i++) 
     201        { 
     202            GameObject obj = new GameObject(50, 50); 
     203            obj.Color = RandomGen.NextColor(); 
     204            obj.Tag = 50.0; 
     205            pItems.Add(obj); 
     206        } 
     207 
     208        GameObject cCaseDialog = new GameObject(LoadImage("laatikko_opening")); // koko debug 
     209        Add(cCaseDialog); 
     210 
     211        Mouse.ListenOn(cCaseDialog, MouseButton.Left, ButtonState.Pressed, delegate 
     212        { 
     213            cCaseDialog.Destroy(); 
     214 
     215            GameObject cCaseFront = new GameObject(200.0, 200.0); 
     216            cCaseFront.Color = new Color(0, 64, 0, 32); 
     217 
     218            ChromaCase cCase = new ChromaCase(pItems, cCaseFront, null, 20); 
     219            cCase.Add(Vector.Zero, 2); 
     220            cCase.ItemReceived += GotItemFromCase; 
     221            cCase.Start(); 
     222 
     223        }, null); 
     224    } 
     225 
     226    void GotItemFromCase(GameObject o) 
     227    { 
     228         
     229    } 
     230 
    194231    /// <summary> 
    195232    /// Asetetaan pelaajalle ohjaimet. 
     
    201238        Keyboard.Listen(Key.Space, ButtonState.Pressed, LiikutaYlos, null, taistelija); 
    202239        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
     240 
     241#if DEBUG 
     242        Keyboard.Listen(Key.C, ButtonState.Pressed, LuoChromaCase, null); 
     243#endif 
    203244    } 
    204245 
Note: See TracChangeset for help on using the changeset viewer.