-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
be0d11d
commit f723f30
Showing
52 changed files
with
605 additions
and
569 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,43 @@ | ||
package Object; | ||
|
||
import javafx.scene.SnapshotParameters; | ||
import javafx.scene.canvas.GraphicsContext; | ||
import javafx.scene.image.ImageView; | ||
import javafx.scene.paint.Color; | ||
import javafx.scene.shape.Rectangle; | ||
import logic.game.GameLogic; | ||
import sharedObject.RenderableHolder; | ||
|
||
public class SwordBeam extends Projectile{ | ||
|
||
ImageView rotatedImage; | ||
SnapshotParameters params; | ||
public SwordBeam(double worldX, double worldY, double angle, GameLogic gameLogic) { | ||
super(worldX, worldY, angle, gameLogic); | ||
speed = 5; | ||
xspeed = Math.cos(angle) * speed; | ||
yspeed = Math.sin(angle) * speed; | ||
dmg = 20; | ||
if(Math.abs(xspeed)>Math.abs(yspeed)) | ||
solidArea = new Rectangle(0, -16, 16, 128); | ||
else | ||
solidArea = new Rectangle(-16,0,128,16); | ||
dmg = 10; | ||
image = RenderableHolder.beam; | ||
rotatedImage = new ImageView(image); | ||
rotatedImage.setRotate(angle*180/Math.PI); | ||
params = new SnapshotParameters(); | ||
params.setFill(Color.TRANSPARENT); | ||
if(Math.abs(xspeed)>Math.abs(yspeed)) { | ||
solidArea = new Rectangle(0, -32, 32, 128); | ||
} | ||
else { | ||
solidArea = new Rectangle(-32,0,128,32); | ||
} | ||
solidScreen = new Rectangle(screenX+solidArea.getX(),screenY+solidArea.getY(),solidArea.getWidth(),solidArea.getHeight()); | ||
RenderableHolder.shootSound.play(0.1); | ||
} | ||
|
||
@Override | ||
public void draw(GraphicsContext gc) { | ||
// TODO Auto-generated method stub | ||
drawHitbox(gc); | ||
gc.drawImage(rotatedImage.snapshot(params, null), screenX, screenY); | ||
|
||
// drawHitbox(gc); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package Util; | ||
|
||
public class Vector <T>{ | ||
private T x,y; | ||
|
||
public Vector(T x , T y) { | ||
this.x = x; | ||
this.y = y; | ||
} | ||
|
||
public T getX() { | ||
return x; | ||
} | ||
|
||
public T getY() { | ||
return y; | ||
} | ||
|
||
public void setX(T x) { | ||
this.x = x; | ||
} | ||
|
||
public void setY(T y) { | ||
this.y = y; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package constant; | ||
|
||
public class Constant { | ||
public static class ScreenSize { | ||
public final static int GAMEWIDTH = 1280; | ||
public final static int GAMEHEIGHT = 720; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package constant; | ||
|
||
public enum Direction { | ||
UP,DOWN,LEFT,RIGHT | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package constant; | ||
|
||
public enum EntityState { | ||
DEFAULT,ALIVE,DEAD,ATTACK,MOVING | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package constant; | ||
|
||
public enum GameState { | ||
PLAYSTATE,PAUSESTATE,NPCSTATE,GAMEOVERSTATE,WINSTATE | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.