public static Jellyfish CreateJellyfish(int x, int y, Directions direction) { if (currentJellyfish == null) { lock (putlock) { if (currentJellyfish == null) { currentJellyfish = new Jellyfish(); } } } currentJellyfish.x = x; currentJellyfish.y = y; currentJellyfish.Direction = direction; return(currentJellyfish); }
//methods-------------------- public void SetJellyfishOrigin(int x, int y, string direction) { jellyfish = Jellyfish.CreateJellyfish(x, y, GetDirection(direction)); lostJellyfish = false; }