Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Final Peoject
- Loading branch information
0 parents
commit 19be37d
Showing
47 changed files
with
2,134 additions
and
0 deletions.
There are no files selected for viewing
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,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="src" path="Resources"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | ||
<classpathentry kind="lib" path="Libs/jl1.0.1.jar"/> | ||
<classpathentry kind="lib" path="Libs/mp3spi1.9.5.jar"/> | ||
<classpathentry kind="lib" path="Libs/tritonus_share.jar"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
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 @@ | ||
/bin |
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,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>Dragon Tale Tutorial</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
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,12 @@ | ||
#Sat Apr 13 11:56:25 EDT 2013 | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 | ||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve | ||
org.eclipse.jdt.core.compiler.compliance=1.5 | ||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate | ||
org.eclipse.jdt.core.compiler.debug.localVariable=generate | ||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.source=1.5 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,10 @@ | ||
107 | ||
8 | ||
22 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 | ||
22 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 18 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 19 17 17 17 17 17 17 17 17 17 18 22 22 22 22 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 18 22 22 22 22 22 19 17 17 17 17 17 17 17 18 22 | ||
22 4 0 0 0 0 0 0 0 0 0 0 13 0 0 0 0 0 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 0 0 0 0 17 17 17 18 22 22 22 22 22 22 22 22 22 22 22 4 0 0 16 0 0 0 0 0 0 0 17 18 22 22 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 18 22 22 22 22 4 0 0 0 0 0 0 0 3 22 | ||
22 4 0 0 0 0 0 0 0 0 0 0 0 0 0 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 0 0 0 0 23 24 25 0 0 0 0 0 0 0 17 17 18 22 22 22 22 22 22 22 19 0 0 10 0 11 0 0 0 0 0 0 0 0 17 17 0 0 0 0 9 0 0 0 0 1 21 2 0 0 0 0 0 0 18 22 22 22 4 0 0 0 0 0 0 0 3 22 | ||
22 4 0 0 0 12 0 0 0 0 0 0 11 1 21 21 2 0 0 0 0 0 0 0 0 0 0 15 0 0 0 0 0 23 25 0 0 0 0 0 0 0 0 0 0 9 11 0 0 0 0 0 17 17 17 17 17 17 17 0 0 1 21 21 21 2 0 0 0 0 0 0 0 0 0 0 0 0 0 23 24 25 0 0 3 22 4 0 0 0 0 0 0 0 18 22 22 4 0 0 0 0 0 0 0 3 22 | ||
22 4 0 0 0 0 0 0 0 0 1 21 21 21 6 22 4 0 0 0 0 0 10 9 0 0 0 0 0 0 10 0 0 0 0 0 0 11 0 0 0 0 0 1 21 21 21 21 2 0 0 0 9 0 0 0 0 9 0 0 0 3 22 22 22 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 22 4 0 0 0 0 0 0 0 0 17 17 0 0 0 0 0 0 0 0 3 22 | ||
22 4 9 0 10 0 0 0 0 11 3 22 22 22 22 22 4 0 0 0 1 21 21 21 21 2 0 0 9 1 21 21 2 0 9 1 21 21 2 0 0 0 0 3 22 22 22 22 4 10 0 1 21 2 0 0 1 21 2 11 1 21 6 22 22 4 0 0 0 0 0 0 0 9 0 0 10 9 0 0 11 0 0 1 21 5 21 2 0 0 0 0 0 0 0 0 0 0 0 10 11 0 0 9 0 3 22 | ||
5 21 21 21 21 21 21 21 21 21 21 6 22 22 22 22 4 0 0 0 3 22 22 22 22 21 21 21 21 21 6 5 21 21 21 21 6 22 4 0 0 0 0 3 22 22 22 5 21 21 21 21 21 21 21 21 21 21 21 21 21 6 22 22 22 4 0 0 0 0 0 1 21 21 21 21 21 21 21 21 21 21 21 21 6 22 5 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 6 |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
Binary file added
BIN
+702 KB
Knuckle's Adventure/Resources/Music/Sonic The Hedgehog 2 HD intro alternate version.mp3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,71 @@ | ||
package Audio; | ||
|
||
import javax.sound.sampled.*; | ||
|
||
public class AudioPlayer { | ||
|
||
private Clip clip; | ||
|
||
public AudioPlayer(String s) { | ||
|
||
try { | ||
|
||
AudioInputStream ais = | ||
AudioSystem.getAudioInputStream( | ||
getClass().getResourceAsStream( | ||
s | ||
) | ||
); | ||
AudioFormat baseFormat = ais.getFormat(); | ||
AudioFormat decodeFormat = new AudioFormat( | ||
AudioFormat.Encoding.PCM_SIGNED, | ||
baseFormat.getSampleRate(), | ||
16, | ||
baseFormat.getChannels(), | ||
baseFormat.getChannels() * 2, | ||
baseFormat.getSampleRate(), | ||
false | ||
); | ||
AudioInputStream dais = | ||
AudioSystem.getAudioInputStream( | ||
decodeFormat, ais); | ||
clip = AudioSystem.getClip(); | ||
clip.open(dais); | ||
} | ||
catch(Exception e) { | ||
e.printStackTrace(); | ||
} | ||
|
||
} | ||
|
||
public void play() { | ||
if(clip == null) return; | ||
stop(); | ||
clip.setFramePosition(0); | ||
clip.start(); | ||
} | ||
|
||
public void stop() { | ||
if(clip.isRunning()) clip.stop(); | ||
} | ||
|
||
public void close() { | ||
stop(); | ||
clip.close(); | ||
} | ||
|
||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
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,65 @@ | ||
package Entity; | ||
|
||
import java.awt.image.BufferedImage; | ||
|
||
public class Animation { | ||
|
||
private BufferedImage[] frames; | ||
private int currentFrame; | ||
|
||
private long startTime; | ||
private long delay; | ||
|
||
private boolean playedOnce; | ||
|
||
public Animation() { | ||
playedOnce = false; | ||
} | ||
|
||
public void setFrames(BufferedImage[] frames) { | ||
this.frames = frames; | ||
currentFrame = 0; | ||
startTime = System.nanoTime(); | ||
playedOnce = false; | ||
} | ||
|
||
public void setDelay(long d) { delay = d; } | ||
public void setFrame(int i) { currentFrame = i; } | ||
|
||
public void update() { | ||
|
||
if(delay == -1) return; | ||
|
||
long elapsed = (System.nanoTime() - startTime) / 1000000; | ||
if(elapsed > delay) { | ||
currentFrame++; | ||
startTime = System.nanoTime(); | ||
} | ||
if(currentFrame == frames.length) { | ||
currentFrame = 0; | ||
playedOnce = true; | ||
} | ||
|
||
} | ||
|
||
public int getFrame() { return currentFrame; } | ||
public BufferedImage getImage() { return frames[currentFrame]; } | ||
public boolean hasPlayedOnce() { return playedOnce; } | ||
|
||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
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,123 @@ | ||
package Entity; | ||
|
||
import TileMap.TileMap; | ||
|
||
import java.awt.*; | ||
import java.awt.image.BufferedImage; | ||
import javax.imageio.ImageIO; | ||
|
||
public class Blast extends MapObject { | ||
|
||
private boolean hit; | ||
private boolean remove; | ||
private BufferedImage[] sprites; | ||
private BufferedImage[] hitSprites; | ||
|
||
public Blast(TileMap tm, boolean right) { | ||
|
||
super(tm); | ||
|
||
facingRight = right; | ||
|
||
moveSpeed = 3.8; | ||
if(right) dx = moveSpeed; | ||
else dx = -moveSpeed; | ||
|
||
width = 16; | ||
height = 16; | ||
cwidth = 14; | ||
cheight = 14; | ||
|
||
// load sprites | ||
try { | ||
|
||
BufferedImage spritesheet = ImageIO.read( | ||
getClass().getResourceAsStream( | ||
"/Sprites/Player/rings ss.gif" | ||
) | ||
); | ||
|
||
sprites = new BufferedImage[8]; | ||
for(int i = 0; i < sprites.length; i++) { | ||
sprites[i] = spritesheet.getSubimage( | ||
i * width, | ||
0, | ||
width, | ||
height | ||
); | ||
} | ||
|
||
hitSprites = new BufferedImage[7]; | ||
for(int i = 0; i < hitSprites.length; i++) { | ||
hitSprites[i] = spritesheet.getSubimage( | ||
i * width, | ||
height, | ||
width, | ||
height | ||
); | ||
} | ||
|
||
animation = new Animation(); | ||
animation.setFrames(sprites); | ||
animation.setDelay(70); | ||
|
||
} | ||
catch(Exception e) { | ||
e.printStackTrace(); | ||
} | ||
|
||
} | ||
|
||
public void setHit() { | ||
if(hit) return; | ||
hit = true; | ||
animation.setFrames(hitSprites); | ||
animation.setDelay(70); | ||
dx = 0; | ||
} | ||
|
||
public boolean shouldRemove() { return remove; } | ||
|
||
public void update() { | ||
|
||
checkTileMapCollision(); | ||
setPosition(xtemp, ytemp); | ||
|
||
if(dx == 0 && !hit) { | ||
setHit(); | ||
} | ||
|
||
animation.update(); | ||
if(hit && animation.hasPlayedOnce()) { | ||
remove = true; | ||
} | ||
|
||
} | ||
|
||
public void draw(Graphics2D g) { | ||
|
||
setMapPosition(); | ||
|
||
super.draw(g); | ||
|
||
} | ||
|
||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Oops, something went wrong.