Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
749f4cb
Merge pull request #6 from Nohbody/master
newScanTron Oct 29, 2014
87c2931
created a readme
newScanTron Oct 29, 2014
960c5a1
got a bit of a working game next step is going to be to add collectab…
newScanTron Nov 1, 2014
1d4be9f
whoa some files to commit
newScanTron Nov 1, 2014
9548f94
a bit of clean up deleted a file or two i dont need
newScanTron Nov 1, 2014
f7900ef
run collectPanel to run the current version of the collector game
newScanTron Nov 1, 2014
8a3f696
Coins are now randomly generated and can be collected in that they di…
newScanTron Nov 1, 2014
cc23801
Merge branch 'master' of https://github.com/Nohbody/serverTime into N…
newScanTron Nov 3, 2014
591721e
Merge branch 'master' of https://github.com/Nohbody/serverTime into N…
newScanTron Nov 3, 2014
72563c4
Merge pull request #15 from newScanTron/Nohbody-master
newScanTron Nov 3, 2014
b22d9b5
Merge pull request #18 from Nohbody/master
newScanTron Nov 7, 2014
01c1634
got a working connection on a new tile map based platformer. needs q…
newScanTron Nov 10, 2014
1ec7ca5
got a working connection on a new tile map based platformer. needs q…
newScanTron Nov 11, 2014
7c4b8bb
trying to start to get a file read in to make the levels
newScanTron Nov 11, 2014
7e1b549
version control can be a pain
newScanTron Nov 12, 2014
1a2925a
version control can be a pain
newScanTron Nov 12, 2014
6778d60
coin creation and score addition
newScanTron Nov 12, 2014
eb249ed
github sucks
newScanTron Nov 12, 2014
0d04745
almost got this github this
newScanTron Nov 12, 2014
5e0459a
proximity detection working pretty well with one weird bug
newScanTron Nov 14, 2014
a928fcd
Game panel can be added. Need to fix the gameLoop() bug
newScanTron Nov 17, 2014
28df114
Game panel can be added. Need to fix the gameLoop() bug
newScanTron Nov 18, 2014
5fb68b5
merge
newScanTron Nov 18, 2014
9b8a4c7
hate
newScanTron Nov 18, 2014
13eb9b4
only one file
newScanTron Nov 18, 2014
78e9354
Merge branch 'master' of https://github.com/Nohbody/serverTime into N…
newScanTron Nov 18, 2014
e75bd1c
got something that moves only right for some reason but it shows that…
newScanTron Nov 19, 2014
3ab7531
whole thing works exactaly as it did before, including the weird rand…
newScanTron Nov 19, 2014
cf49bde
deleted unessisary directorys from the collector
newScanTron Nov 19, 2014
cd0266f
proximity detection works like a charm.
newScanTron Nov 19, 2014
837153a
cleaned up much of the code for the collector game
newScanTron Nov 19, 2014
c31b69b
got some fun sort of unintentioned flickering happening as a part of …
newScanTron Nov 19, 2014
8749a09
Updated Snake
Nohbody Nov 19, 2014
11b66c1
Online users
Nohbody Nov 19, 2014
bf08149
Forgot the Driver
Nohbody Nov 19, 2014
7897021
got spencers game up here
newScanTron Nov 19, 2014
d50959d
Scores submit to DB
Nohbody Nov 19, 2014
e559f68
trying to fix the Snake package issue
newScanTron Nov 20, 2014
75f9f72
trying to fix the Snake package issue. i changed the name completely…
newScanTron Nov 20, 2014
7b2a7f0
Multi-threading Saves All
Nohbody Nov 28, 2014
1bb4d24
Some Snake tweaking
Nohbody Nov 28, 2014
d5e77cb
got some multi thread action, the database connection still needs to …
newScanTron Nov 28, 2014
5b4b6e7
Merge remote-tracking branch 'origin/master'
newScanTron Nov 28, 2014
39e91b8
got some multi thread action, the database connection still needs to …
newScanTron Nov 28, 2014
cbc27db
Team Deathmatch
Nohbody Nov 28, 2014
4b801ea
have mulit thead, that we now don't need. I like the new physics so …
newScanTron Nov 28, 2014
2e181e1
Merge remote-tracking branch 'origin/master'
newScanTron Nov 28, 2014
019c088
new physics
newScanTron Nov 28, 2014
1d3f909
got all the necessary dataBase connections running, still need to ad…
newScanTron Nov 28, 2014
a09a6cc
sync all the commits
newScanTron Nov 29, 2014
873a76f
It works now
Nohbody Nov 29, 2014
7e65e59
hopfully this will update the collector so it works
newScanTron Nov 29, 2014
60a97dd
Merge remote-tracking branch 'origin/master'
newScanTron Nov 29, 2014
3ce99af
this is now more properly multi-threaded
newScanTron Nov 29, 2014
1f6f850
Force stop Collector when it's done
Nohbody Nov 29, 2014
5092ce3
Statistics
Nohbody Nov 29, 2014
ddb26bc
I stopped the freaking lag
Nohbody Nov 29, 2014
fa40c60
Fixed chat while countdown bug
Nohbody Nov 29, 2014
921d984
Fixed quotations bug
Nohbody Nov 29, 2014
758a7ab
this is now more properly multi-threaded
newScanTron Nov 30, 2014
725c1a7
collectorPApplet to the best of my knowledge should be working the sa…
newScanTron Nov 30, 2014
b71a931
This is literally the latest version I have where things look like a …
Nohbody Nov 30, 2014
b9c33c9
im kinda struggling, cant quite seem to figure out why it doing what …
newScanTron Dec 1, 2014
8504755
I was getting some strange stuff going on, probably because this game…
newScanTron Dec 1, 2014
e44aeac
A few bug fixes
Nohbody Dec 1, 2014
2fa3a24
A fix for that registration fix
Nohbody Dec 1, 2014
3f58998
better level that makes collector more fun to play.
newScanTron Dec 1, 2014
5361baf
better level that makes collector more fun to play.
newScanTron Dec 1, 2014
03d4f0b
Merge remote-tracking branch 'origin/master'
newScanTron Dec 1, 2014
116c41d
I'm an idiot.
Nohbody Dec 1, 2014
01dd5df
Removed one square
Nohbody Dec 1, 2014
6e1a7a3
Timestamp down to the millisecond
Nohbody Dec 1, 2014
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
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Created by .gitignore support plugin (hsz.mobi)
serverTime.iml
.idea
junit-4.7.jar
jbox2d-library-2.2.1.1.jar
jbox2d-testbed-2.2.1.1.jar
jbox2d-serialization-1.1.0.jar
src/collector/src/tileMapStuff/codeNameMetalMayhem.java
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
serverTime
==========

server exploration
this is a group project for our Software enginering class
building a game that will allow two users to compete in different games by havging common variables representing
different objects in the individual games.
run the game class to run the currnet collector game

1 change: 1 addition & 0 deletions out/production/serverTime/Color.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BLACK
Binary file removed out/production/serverTime/DBOps.class
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file added out/production/serverTime/Snake/GameApplet$1.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added out/production/serverTime/Snake/GameApplet.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added out/production/serverTime/collector/ball.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added out/production/serverTime/collector/box.png
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.
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.
Binary file added out/production/serverTime/collector/src/PNG/coin.png
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.
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
17 changes: 17 additions & 0 deletions out/production/serverTime/collector/src/tileMapStuff/levelOne.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
1,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,1,0,0,1
1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,1
1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
1,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1
1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1
1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1


Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added out/production/serverTime/gui/ChatPanel$1.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added out/production/serverTime/gui/ChatPanel.class
Binary file not shown.
Binary file added out/production/serverTime/gui/GUI.class
Binary file not shown.
Binary file added out/production/serverTime/gui/LoginPanel$1.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added out/production/serverTime/gui/LoginPanel.class
Binary file not shown.
Binary file added out/production/serverTime/gui/MenuPanel$1.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added out/production/serverTime/gui/MenuPanel.class
Binary file not shown.
Binary file removed out/production/serverTime/main.class
Binary file not shown.
Binary file added out/production/serverTime/main/DBOps.class
Binary file not shown.
Binary file added out/production/serverTime/main/Driver$1.class
Binary file not shown.
Binary file added out/production/serverTime/main/Driver.class
Binary file not shown.
Binary file added out/production/serverTime/main/Listener.class
Binary file not shown.
Binary file not shown.
Binary file added out/production/serverTime/main/TestPanel.class
Binary file not shown.
Binary file added out/production/serverTime/main/User.class
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 modified out/test/serverTime/DBOpsTest$TestJunit.class
Binary file not shown.
Binary file modified out/test/serverTime/DBOpsTest.class
Binary file not shown.
Binary file modified out/test/serverTime/JunitTestSuite.class
Binary file not shown.
Binary file modified out/test/serverTime/testRunner.class
Binary file not shown.
12 changes: 12 additions & 0 deletions out/test/test.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/serverTime" isTestSource="true" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

36 changes: 0 additions & 36 deletions src/Driver.java

This file was deleted.

9 changes: 0 additions & 9 deletions src/Snake/SnakeApplet.html

This file was deleted.

Binary file removed src/Snake/bin/GameApplet$Block.class
Binary file not shown.
Binary file removed src/Snake/bin/GameApplet$Snake.class
Binary file not shown.
Binary file removed src/Snake/bin/GameApplet.class
Binary file not shown.
7 changes: 0 additions & 7 deletions src/Snake/bin/java.policy.applet

This file was deleted.

Binary file removed src/Snake/core.jar
Binary file not shown.
8 changes: 0 additions & 8 deletions src/View.java

This file was deleted.

40 changes: 40 additions & 0 deletions src/collector/src/tileMapStuff/Coin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package collector.src.tileMapStuff;

import java.awt.*;

/**
* Created by newScanTron on 11/11/2014.
*/
public class Coin extends Entity
{
/**
* Create a new entity in the game
* @param map The map this entity is going to wander around
* @param x The initial x position of this entity in grid cells
* @param y The initial y position of this entity in grid cells
*/
Map map = new Map();
public Coin(Map map, float x, float y)
{
super(map, x, y);
}

public void paint(Graphics g) {
// work out the screen position of the entity based on the
// x/y position and the size that tiles are being rendered at. So
// if we're at 1.5,1.5 and the tile size is 10 we'd render on screen
// at 15,15.
int xp = (int) (Map.TILE_SIZE * x);
int yp = (int) (Map.TILE_SIZE * y);
g.setColor(new Color(222, 104, 244));
g.drawRect (xp ,yp , Map.TILE_SIZE, Map.TILE_SIZE);

}
//proximity detection
public float proximity(float x, float y)
{
float distance = 0;
distance = (float) Math.sqrt(Math.pow((this.x - x), 2)+Math.pow((this.y -y), 2));
return distance;
}
}
119 changes: 119 additions & 0 deletions src/collector/src/tileMapStuff/Entity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
package collector.src.tileMapStuff;

import main.DBOps;
import main.Driver;

import java.awt.*;

public class Entity {
/** The x and y position of this entity in terms of grid cells
* that make up the map object*/
protected float x;
protected float y;
protected Map map;
/** The size of this entity, this is used to calculate collisions with walls */
private float size = 0.4f;
private boolean grounded = false;
protected int score = 0;
protected Color playColor = new Color(203, 200, 106);
private Thread scoreThread = new Thread(new UpdateScore());

public Entity(Map map, float x, float y)
{
this.map = map;
this.x = x;
this.y = y;
}
public float getX()
{
return x;
}

public float getY()
{
return y;
}

public void setScore(int add)
{
this.score += add;
}

public boolean move(float dx, float dy)
{
float nx = x + dx;
float ny = y + dy;
// check if the new position of the entity collides with
// anything
if (validLocation(nx, ny)) {
// if it doesn't then change our position to the new position
x = nx;
y = ny;
if (map.isCoin(x, y, 1))
{
map.setClear((int)x, (int)y);
setScore(1);
scoreThread = new Thread(new UpdateScore());
scoreThread.start();
System.out.println(score);
}
return true;
}
return false;
}

public boolean validLocation(float nx, float ny)
{

grounded = false;
if (map.isBlocked(nx, ny))
{
return false;
}
if (map.isBlocked(nx + size, ny))
{
return false;
}
if (map.isBlocked(nx, ny + size))
{
grounded = true;
return false;
}
if (map.isBlocked(nx + size, ny + size))
{
grounded = true;
return false;
}
return true;
}

// check to see if Entity is grounded
public boolean isGrounded()
{
grounded = true;
if (map.isBlocked(x, y +size))
{
grounded = true;
}
return grounded;
}

public void paint(Graphics g) {
int xp = (int) (Map.TILE_SIZE * x);
int yp = (int) (Map.TILE_SIZE * y);
g.setColor(playColor);
g.fillRect(xp, yp, 10, 10);
}

private class UpdateScore implements Runnable {

public void run() {
int DBscore = Integer.parseInt((DBOps.getData("scores", "1", "id", "Collector")).get(0)) + 5;
DBOps.updateData("scores", "Collector", "" + DBscore, "id", "1");
DBscore = Integer.parseInt((DBOps.getData("users", Driver.currentUser.getName(), "user", "scoredCollector")).get(0)) + 5;
DBOps.updateData("users", "scoredCollector", "" + DBscore, "user", Driver.currentUser.getName() );
return;
}

}
}
Loading