예제 #1
0
        public void SpawnItem()
        {
            DrawableItems d=new DrawableItems();
            Items item=ItemCollection[Framework.rndInt(0,ItemCollection.Length)];
            Places place=PlaceCollection[Config.LoggedInUser.difficulty][Framework.rndInt(0,PlaceCollection[Config.LoggedInUser.difficulty].Length)];
            d.Parent=drawArea1;
            d.Image=item.Image;
            d.Bounds=new Rectangle(Framework.rndInt(64,736),Framework.rndInt(500,506),d.Image.Width,d.Image.Height);
            d.MouseDown+= new DrawableItems.ItemMouseEventHandler(ClickMovable);
            d.MouseMove+= new DrawableItems.ItemMouseEventHandler(MoveMovable);
            drawArea1.Items.Add(d);
            goal=place;
            lblInstruction.Text="Lägg "+item.Name+item.Ending+" "+place.Name+"; "+Convert.ToString(total-correct)+" kvar";
            string itemsound=item.Name+item.Ending;
            itemsound=itemsound.ToLower().Replace(" ","").Replace('ä','a').Replace('å','a').Replace('ö','o')+".wav";
            string placesound=place.Name;
            placesound=placesound.ToLower().Replace(" ","").Replace('ä','a').Replace('å','a').Replace('ö','o')+".wav";

            Framework.sndPlay.SoundLocation=@"Sounds\Prepositions\"+itemsound;
            Framework.sndPlay.PlaySync();
            Framework.sndPlay.SoundLocation=@"Sounds\Prepositions\"+placesound;
            Framework.sndPlay.Play();
        }
예제 #2
0
 public void SpawnItem()
 {
     DrawableItems d=new DrawableItems();
     Items item=ItemCollection[Framework.rndInt(0,ItemCollection.Length)];
     Places place=PlaceCollection[Config.LoggedInUser.difficulty][Framework.rndInt(0,PlaceCollection[Config.LoggedInUser.difficulty].Length)];
     d.Parent=drawArea1;
     d.Image=item.Image;
     d.Bounds=new Rectangle(Framework.rndInt(64,736),Framework.rndInt(500,506),d.Image.Width,d.Image.Height);
     //d.MouseEnter+= new DrawableItems.ItemEventHandler(Framework.EnterClickable);
     //d.MouseLeave+= new DrawableItems.ItemEventHandler(Framework.LeaveClickable);
     d.MouseDown+= new DrawableItems.ItemMouseEventHandler(ClickMovable);
     d.MouseMove+= new DrawableItems.ItemMouseEventHandler(MoveMovable);
     drawArea1.Items.Add(d);
     goal=place;
     lblInstruction.Text="Lägg "+item.Name+item.Ending+" "+place.Name+"; "+Convert.ToString(total-correct)+" kvar";
 }