Browse Source

Merge remote-tracking branch 'origin/main'

main
Thoumi Ngonga Brice 2 years ago
parent
commit
88d221ea3b
  1. 5
      build-project.sh
  2. 6
      src/main/java/Snake/Controller.java
  3. 64
      src/main/java/Snake/TextView.java
  4. BIN
      target/hellsgamers-1.0-SNAPSHOT.jar
  5. 2
      target/maven-archiver/pom.properties
  6. 21
      target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  7. 18
      target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
  8. 0
      target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst

5
build-project.sh

@ -1 +1,4 @@
#!/bin/bash
cd hellsgamers
mvn clean install
read -p //enter to exit

6
src/main/java/Snake/Controller.java

@ -0,0 +1,6 @@
package Snake;
public class Controller {
}

64
src/main/java/Snake/TextView.java

@ -0,0 +1,64 @@
package Snake;
import java.awt.*;
public class TextView implements Drawable
{
public enum AnchorType { Left, Center, Right };
private String text;
private Point position;
private boolean visible;
private AnchorType anchor;
public TextView(String text, Point position)
{
this(text, position, true);
}
public TextView(String text, Point position, boolean visible)
{
this.text = text;
this.position = position;
this.visible = visible;
this.anchor = AnchorType.Center;
}
public void setText(String newText)
{
text = newText;
}
public void setVisibility(boolean visibility)
{
visible = visibility;
}
public void setAnchor(AnchorType newAnchor)
{
anchor = newAnchor;
}
@Override
public void draw(Graphics g)
{
if(visible)
{
FontMetrics fontMetrics = g.getFontMetrics();
int x = position.x;
int y = position.y + fontMetrics.getHeight() / 2;
if (anchor == AnchorType.Center)
x -= fontMetrics.stringWidth(text) / 2;
else if (anchor == AnchorType.Right)
x -= fontMetrics.stringWidth(text);
g.setColor(Color.WHITE);
g.drawString(text, x, y);
}
}
}

BIN
target/hellsgamers-1.0-SNAPSHOT.jar

2
target/maven-archiver/pom.properties

@ -1,5 +1,5 @@
#Generated by Maven
#Sun Jan 29 13:17:20 CET 2023
#Mon Feb 06 20:43:15 CET 2023
groupId=Hellsgamers
artifactId=hellsgamers
version=1.0-SNAPSHOT

21
target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

@ -1 +1,22 @@
Snake\TextView.class
MenuPanel.class
PingPong\Score.class
PingPong\GamePanel.class
Snake\Window.class
Snake\Snake$1.class
MenuPanel$GameFrame.class
PingPong\Ball.class
Snake\TextView$AnchorType.class
MenuPanel$AL.class
Main.class
PingPong\Paddle.class
Snake\Apple.class
Snake\Snake.class
PingPong\GameFrame.class
Snake\Controller.class
Snake\Drawable.class
MenuFrame.class
Snake\Snake$SnakeDirection.class
Snake\SnakeView.class
Snake\AppleView.class
Snake\GameView.class

18
target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

@ -1 +1,17 @@
C:\Users\Berkan\IdeaProjects\hellsgamers\src\main\java\Main.java
C:\Users\senni\IdeaProjects\hellsgamers\src\main\java\MenuPanel.java
C:\Users\senni\IdeaProjects\hellsgamers\src\main\java\PingPong\Paddle.java
C:\Users\senni\IdeaProjects\hellsgamers\src\main\java\PingPong\Ball.java
C:\Users\senni\IdeaProjects\hellsgamers\src\main\java\Snake\AppleView.java
C:\Users\senni\IdeaProjects\hellsgamers\src\main\java\Snake\Controller.java
C:\Users\senni\IdeaProjects\hellsgamers\src\main\java\PingPong\GamePanel.java
C:\Users\senni\IdeaProjects\hellsgamers\src\main\java\Snake\Snake.java
C:\Users\senni\IdeaProjects\hellsgamers\src\main\java\MenuFrame.java
C:\Users\senni\IdeaProjects\hellsgamers\src\main\java\Snake\Apple.java
C:\Users\senni\IdeaProjects\hellsgamers\src\main\java\Snake\Window.java
C:\Users\senni\IdeaProjects\hellsgamers\src\main\java\Main.java
C:\Users\senni\IdeaProjects\hellsgamers\src\main\java\Snake\SnakeView.java
C:\Users\senni\IdeaProjects\hellsgamers\src\main\java\Snake\TextView.java
C:\Users\senni\IdeaProjects\hellsgamers\src\main\java\PingPong\Score.java
C:\Users\senni\IdeaProjects\hellsgamers\src\main\java\Snake\GameView.java
C:\Users\senni\IdeaProjects\hellsgamers\src\main\java\PingPong\GameFrame.java
C:\Users\senni\IdeaProjects\hellsgamers\src\main\java\Snake\Drawable.java

0
target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst

Loading…
Cancel
Save