Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snake length user input #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/DataOfSquare.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public DataOfSquare(int col){

//Lets add the color to the arrayList
C.add(Color.darkGray);//0
C.add(Color.BLUE); //1
C.add(Color.white); //2
C.add(Color.RED); //1
C.add(Color.yellow); //2
color=col;
square = new SquarePanel(C.get(color));
}
Expand Down
8 changes: 5 additions & 3 deletions src/ThreadsController.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import java.util.ArrayList;

import java.util.Scanner;

//Controls all the game logic .. most important class in this project.
public class ThreadsController extends Thread {
ArrayList<ArrayList<DataOfSquare>> Squares= new ArrayList<ArrayList<DataOfSquare>>();
Tuple headSnakePos;
int sizeSnake=3;
long speed = 50;
Scanner sc = new Scanner(System.in);
System.out.println("Enter the size of snake");
int sizeSnake=sc.nextInt;
long speed = 40;
public static int directionSnake ;

ArrayList<Tuple> positions = new ArrayList<Tuple>();
Expand Down