Skip to content
Snippets Groups Projects
Commit 544f7bee authored by Vesa Lappalainen's avatar Vesa Lappalainen :bicyclist:
Browse files

live15 x lokaaliksi muuttujaksi

parent a54d82a4
No related branches found
No related tags found
No related merge requests found
......@@ -8,15 +8,16 @@ using Jypeli.Widgets;
public class Pallot : PhysicsGame
{
private double x = -200;
public override void Begin()
{
PhysicsObject pallo;
double x = -200;
PhysicsObject p = Luo(this, 100, 100);
pallo = Lisaa(this);
pallo = Lisaa(this, x += 100);
pallo.Color = Color.Yellow;
pallo = Lisaa(this);
pallo = Lisaa(this, x += 100);
Vaihda(pallo, Color.Red);
Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli");
}
......@@ -28,9 +29,10 @@ public class Pallot : PhysicsGame
}
public PhysicsObject Lisaa(Pallot peli)
public static PhysicsObject Lisaa(Pallot peli, double x)
{
return Luo(peli, x += 100, -200);
// x += 100;
return Luo(peli, x, -200);
}
......
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