-
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
Showing
27 changed files
with
691 additions
and
288 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 |
---|---|---|
|
@@ -115,4 +115,10 @@ Desktop.ini | |
# Recycle Bin used on file shares | ||
$RECYCLE.BIN/ | ||
|
||
#Gradle | ||
build.gradle | ||
gradle/ | ||
gradlew | ||
gradlew.bat | ||
|
||
|
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,2 +1,10 @@ | ||
SegwaySimulator | ||
=============== | ||
##Changelog: | ||
###v0.2 | ||
+ Added gyro support | ||
+ Added golden cookie | ||
+ More levels | ||
+ New music | ||
+ New death screen! (Dark Souls inspired??) | ||
+ Tip |
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.
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 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<level width="3000" height="780"> | ||
<entity x="260" y="100" type="curvyPlatform1"/> | ||
<entity x="50" y="300" type="player"/> | ||
</level> |
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,50 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<level width="14000" height="5500"> | ||
<entity x="100" y="5000" type="platform1"/> | ||
<entity x="400" y="4900" type="platform2"/> | ||
<entity x="700" y="4800" type="platform2"/> | ||
<entity x="1000" y="4700" type="platform2"/> | ||
<entity x="1300" y="4600" type="platform2"/> | ||
<entity x="1600" y="4500" type="platform2"/> | ||
<entity x="1900" y="4400" type="platform2"/> | ||
<entity x="2200" y="4300" type="platform2"/> | ||
<entity x="2500" y="4200" type="platform2"/> | ||
<entity x="2800" y="4100" type="platform2"/> | ||
<entity x="3100" y="4000" type="platform2"/> | ||
<entity x="3400" y="3900" type="platform2"/> | ||
<entity x="3700" y="3800" type="platform2"/> | ||
<entity x="4000" y="3700" type="platform2"/> | ||
<entity x="4300" y="3600" type="platform2"/> | ||
<entity x="4600" y="3500" type="platform2"/> | ||
<entity x="4900" y="3400" type="platform2"/> | ||
<entity x="5200" y="3300" type="platform2"/> | ||
<entity x="5500" y="3200" type="platform2"/> | ||
<entity x="5800" y="3100" type="platform2"/> | ||
<entity x="6100" y="3000" type="platform2"/> | ||
<entity x="6400" y="2900" type="platform2"/> | ||
<entity x="6700" y="2800" type="platform2"/> | ||
<entity x="7000" y="2700" type="platform2"/> | ||
<entity x="7300" y="2600" type="platform2"/> | ||
<entity x="7600" y="2500" type="platform2"/> | ||
<entity x="7900" y="2400" type="platform2"/> | ||
<entity x="8200" y="2300" type="platform2"/> | ||
<entity x="8500" y="2200" type="platform2"/> | ||
<entity x="8800" y="2100" type="platform2"/> | ||
<entity x="9100" y="2000" type="platform2"/> | ||
<entity x="9400" y="1900" type="platform2"/> | ||
<entity x="9700" y="1800" type="platform2"/> | ||
<entity x="10000" y="1700" type="platform2"/> | ||
<entity x="10300" y="1600" type="platform2"/> | ||
<entity x="10600" y="1500" type="platform2"/> | ||
<entity x="10900" y="1400" type="platform2"/> | ||
<entity x="11200" y="1300" type="platform2"/> | ||
<entity x="11500" y="1200" type="platform2"/> | ||
<entity x="11800" y="1100" type="platform2"/> | ||
<entity x="12100" y="1000" type="platform2"/> | ||
<entity x="12400" y="900" type="platform2"/> | ||
<entity x="12700" y="800" type="platform2"/> | ||
<entity x="13000" y="700" type="platform2"/> | ||
<entity x="13300" y="600" type="platform2"/> | ||
<entity x="13600" y="700" type="golden_cookie"/> | ||
<entity x="50" y="5200" type="player"/> | ||
</level> |
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
2 changes: 1 addition & 1 deletion
2
...chalmers/segway/managers/GameManager.java → src/se/chalmers/segway/game/GameManager.java
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,4 +1,4 @@ | ||
package se.chalmers.segway.managers; | ||
package se.chalmers.segway.game; | ||
|
||
|
||
/** | ||
|
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,109 @@ | ||
package se.chalmers.segway.game; | ||
|
||
import org.andengine.engine.Engine; | ||
import org.andengine.engine.handler.timer.ITimerCallback; | ||
import org.andengine.engine.handler.timer.TimerHandler; | ||
|
||
import se.chalmers.segway.entities.Player; | ||
|
||
import com.badlogic.gdx.physics.box2d.Contact; | ||
import com.badlogic.gdx.physics.box2d.ContactImpulse; | ||
import com.badlogic.gdx.physics.box2d.ContactListener; | ||
import com.badlogic.gdx.physics.box2d.Fixture; | ||
import com.badlogic.gdx.physics.box2d.Manifold; | ||
import com.badlogic.gdx.physics.box2d.BodyDef.BodyType; | ||
|
||
public class PlayerContact implements ContactListener { | ||
|
||
private Player player; | ||
private Engine engine; | ||
|
||
|
||
/** | ||
* @return the player | ||
*/ | ||
public Player getPlayer() { | ||
return player; | ||
} | ||
|
||
/** | ||
* @param player the player to set | ||
*/ | ||
public void setPlayer(Player player) { | ||
this.player = player; | ||
} | ||
|
||
/** | ||
* @return the engine | ||
*/ | ||
public Engine getEngine() { | ||
return engine; | ||
} | ||
|
||
/** | ||
* @param engine the engine to set | ||
*/ | ||
public void setEngine(Engine engine) { | ||
this.engine = engine; | ||
} | ||
|
||
@Override | ||
public void beginContact(Contact contact) { | ||
final Fixture x1 = contact.getFixtureA(); | ||
final Fixture x2 = contact.getFixtureB(); | ||
|
||
if (x1.getBody().getUserData() != null | ||
&& x2.getBody().getUserData() != null) { | ||
if (x2.getBody().getUserData().equals("platform1") | ||
|| x2.getBody().getUserData().equals("platform2") | ||
|| x2.getBody().getUserData().equals("platform3")) { | ||
player.setContact(true); | ||
} | ||
} | ||
|
||
if (x1.getBody().getUserData().equals("player") | ||
&& x2.getBody().getUserData().equals("platform3")) { | ||
x2.getBody().setType(BodyType.DynamicBody); | ||
} | ||
|
||
if (x1.getBody().getUserData().equals("player") | ||
&& x2.getBody().getUserData().equals("platform2")) { | ||
engine.registerUpdateHandler(new TimerHandler(0.2f, | ||
new ITimerCallback() { | ||
public void onTimePassed( | ||
final TimerHandler pTimerHandler) { | ||
pTimerHandler.reset(); | ||
engine.unregisterUpdateHandler(pTimerHandler); | ||
x2.getBody().setType(BodyType.DynamicBody); | ||
} | ||
})); | ||
} | ||
|
||
} | ||
|
||
@Override | ||
public void endContact(Contact contact) { | ||
final Fixture x1 = contact.getFixtureA(); | ||
final Fixture x2 = contact.getFixtureB(); | ||
|
||
if (x1.getBody().getUserData() != null | ||
&& x2.getBody().getUserData() != null) { | ||
if (!x2.getBody().getUserData().equals("player")) { | ||
player.setContact(false); | ||
System.out.println("End contact"); | ||
} | ||
} | ||
|
||
} | ||
|
||
@Override | ||
public void preSolve(Contact contact, Manifold oldManifold) { | ||
|
||
} | ||
|
||
@Override | ||
public void postSolve(Contact contact, ContactImpulse impulse) { | ||
|
||
} | ||
|
||
} |
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,27 @@ | ||
package se.chalmers.segway.game; | ||
/** | ||
* Model for an basic upgrade. | ||
* @author Wiixtor! | ||
* | ||
*/ | ||
public class Upgrade { | ||
private int cost; | ||
private boolean enabled; | ||
|
||
/** | ||
* | ||
* @param cost The amount of cookies it will cost to purchase this upgrade. | ||
*/ | ||
public Upgrade(int cost) { | ||
this.cost = cost; | ||
this.enabled = false; | ||
} | ||
|
||
public void enable() { | ||
this.enabled = true; | ||
} | ||
|
||
public void disable() { | ||
this.enabled = false; | ||
} | ||
} |
Oops, something went wrong.