Skip to content
Snippets Groups Projects
Commit 54c5885e authored by Klemettinen Veera Eveliina's avatar Klemettinen Veera Eveliina
Browse files

lisättiin kuva rastista

parent 6a9a40de
No related branches found
No related tags found
No related merge requests found
Harjoitustyo/Suunnistuspeli/Content/rasti.png

415 B

......@@ -7,9 +7,29 @@ using System.Collections.Generic;
public class Suunnistuspeli : PhysicsGame
{
Image olionKuva = LoadImage("rasti");
public override void Begin()
{
// Kirjoita ohjelmakoodisi tähän
Camera.ZoomToLevel();
LisääRasti(100);
void LisääRasti(int n)
{
int i = 0;
for (i = 1; i <= n ; i++)
{
PhysicsObject rasti = new PhysicsObject(40, 40);
rasti.Shape = Shape.Rectangle;
rasti.X = RandomGen.NextInt(400);
rasti.Y = RandomGen.NextInt(200);
rasti.Image = olionKuva;
Add(rasti);
}
}
PhoneBackButton.Listen(ConfirmExit, "Lopeta peli");
Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment