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

Tian #2

Open
wants to merge 25 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
23 changes: 23 additions & 0 deletions src/game/Ball.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package game;
//this class creates the bullets
import java.awt.Rectangle;

class Ball extends Rectangle{
double xx, yy = -10; //position
double vx, vy = 0; //speed
int size = 5; //the diameter
boolean intersecting; //wether or not a bullet is touching a wall
boolean player1sbullet; //this shows who the bullet belongs to

Ball(boolean player1sbullet){
//puts them off screen, not moving
this.x = -10;
this.y = -10;
this.width = size;
this.height = size;
this.vx = vx; //move this many pixels each time
this.vy = vy;
this.intersecting = false;
this.player1sbullet = player1sbullet;
}
}
7 changes: 0 additions & 7 deletions src/game/LineWalls.java

This file was deleted.

82 changes: 0 additions & 82 deletions src/game/MainGame.java

This file was deleted.

26 changes: 26 additions & 0 deletions src/game/Tank.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package game;
//this will create the tank objects
import java.awt.Rectangle;
import java.awt.image.BufferedImage;
class Tank extends Rectangle{
BufferedImage img;
BufferedImage img2;
int angle;
int speed;
double xx; //position
double yy;
Tank(int x, int y){
this.xx = x;
this.yy = y;
this.angle = 0;
this.x = x;
this.y = y;
this.width = 20;
this.height = 30;
this.angle = 90;
this.speed = 5;
img = Walls.loadImage("src/game/tank2.png");
img2 = Walls.loadImage("src/game/tank1.png");

}
}
168 changes: 0 additions & 168 deletions src/game/TankTrouble.java

This file was deleted.

22 changes: 22 additions & 0 deletions src/game/Wall.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package game;
//this will create the walls
import java.awt.Rectangle;

class Wall extends Rectangle{
//int x,y,width,hight; //position
boolean v; //wether or not it is vertical
Wall(int x, int y, boolean vertical){
this.x = x;
this.y = y;
this.v = vertical;
//sets the width and height based on wether or not it is vertical
if(vertical) {
this.width = 3;
this.height = 100;
}
else {
this.width = 100;
this.height = 3;
}
}
}
Loading