private void Move() { map[pos.x, pos.y] = 0; CheckCollision(); if (advMove) { if (moves.x > 0) { moves.x--; pos.x += dir.x; } else if (moves.y > 0) { moves.y--; pos.y += dir.y; } if (moves.y == 0) { moves = vel; } } else { pos.Add(dir); } map[pos.x, pos.y] = 3; FrameDrawer.DrawFrame(map); }
public void Start() { Console.CursorVisible = false; Console.SetCursorPosition(0, 0); Console.SetWindowSize(size.x, size.y); Console.SetBufferSize(size.x, size.y); FrameDrawer.DrawFrame(map); ball.Start(); while (true) { Update(); } }
private void Move(object source, ElapsedEventArgs e) { if (pos.y != 0 && dir == 1) { map[pos.x, pos.y] = 0; pos.y--; map[pos.x, pos.y] = 4; } if (pos.y != map.size.y - 1 && dir == -1) { map[pos.x, pos.y] = 0; pos.y++; map[pos.x, pos.y] = 4; } FrameDrawer.DrawFrame(map); }