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

palautetaan tuple

parent 3541e252
No related branches found
No related tags found
No related merge requests found
......@@ -15,9 +15,9 @@ public class Pallot : PhysicsGame
{
double x = -200;
PhysicsObject p = Luo(this, 100, 100);
PhysicsObject pallo = Lisaa(this, ref x);
(PhysicsObject pallo, x) = Lisaa(this, x);
pallo.Color = Color.Yellow;
pallo = Lisaa(this, ref x);
(pallo, x) = Lisaa(this, x);
Vaihda(pallo, Color.Red);
Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli");
}
......@@ -28,11 +28,10 @@ public class Pallot : PhysicsGame
pallo.Color = c;
}
public static PhysicsObject Lisaa(Game peli, ref double x)
public static (PhysicsObject, double) Lisaa(Game peli, double x)
{
double uusiX = x + 100;
x = uusiX;
return Luo(peli, uusiX, -200);
return (Luo(peli, uusiX, -200), uusiX);
}
......
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