Skip to content

Commit

Permalink
Merge branch 'front-end' of https://github.com/Alan19/TapMonsters.git
Browse files Browse the repository at this point in the history
…into front-end
  • Loading branch information
Alan19 committed Feb 16, 2017
2 parents 5a2d022 + 476ffc2 commit 5b3462f
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 75 deletions.
26 changes: 15 additions & 11 deletions TapMonster/src/MonsterDex/MonsterDex.java
Expand Up @@ -5,8 +5,11 @@
import java.util.List;

import guiPractice.ClickableScreen;
import guiPractice.components.Action;
import guiPractice.components.Button;
import guiPractice.components.Graphic;
import guiPractice.components.TextArea;
import guiPractice.components.TextLabel;
import guiPractice.components.Visible;
import interfaces.MonDexInterface;

Expand All @@ -17,6 +20,8 @@ public class MonsterDex extends ClickableScreen implements Runnable{
private Button Back;
private Graphic Background;
private static Graphic MonsterImg;
private static TextArea Description;
private TextLabel Name;

private static int PosX = 100;
private static int PosY = 100;
Expand All @@ -29,31 +34,30 @@ public MonsterDex(int width,int height) {
}


public void initObjects(ArrayList<Visible> viewObjects){
public void initObjects(final ArrayList<Visible> viewObjects){
Monsters = new ArrayList<MonDexInterface>();
Next = new Button(getWidth() - 110, getHeight() - 70, 90, 50, "Next", Color.decode("#a52a2a"), null);
Back = new Button(20, getHeight() - 70, 90, 50, "Back", Color.decode("#a52a2a"), null);
Back = new Button(20, getHeight() - 70, 90, 50, "Back", Color.decode("#a52a2a"), new Action() {

public void act() {
MonID++;
}
});

Background = new Graphic(0,0,getWidth(),getHeight(),"src/resources/background.jpg");
MonsterImg = getMonster();
viewObjects.add(Background);
viewObjects.add(Next);
viewObjects.add(Back);
viewObjects.add(MonsterImg);
// for(int i = MonID; i < MonID+1; i++){
// MonsterImg = new Graphic(PosX,PosY, 100,100,"src/MonsterSprites/"+MonID+".gif");
// PosX += 200;
// MonID++;
// viewObjects.add(MonsterImg);
// }
}

}

private MonsterGraphic getMonster() {
private Graphic getMonster() {
MonID++;
return new MonsterGraphic(PosX, PosY, 100, 100, MonID);
}


public void run() {
// TODO Auto-generated method stub

Expand Down
18 changes: 10 additions & 8 deletions TapMonster/src/MonsterDex/MonsterDexScreen.java
Expand Up @@ -3,23 +3,25 @@
import guiPractice.GUIApplication;

public class MonsterDexScreen extends GUIApplication{

public static MonsterDexScreen profile;

public MonsterDexScreen() {
super(1200,900);
// TODO Auto-generated constructor stub
public static void main(String[] args) {
MonsterDexScreen profile = new MonsterDexScreen();
Thread app = new Thread(profile);
app.start();
}

@Override
protected void initScreen() {
MonsterDex dex =
new MonsterDex(getWidth(),getHeight());
setScreen(dex);
}

public static void main(String[] args) {
MonsterDexScreen profile = new MonsterDexScreen();
Thread app = new Thread(profile);
app.start();
public MonsterDexScreen() {
super(1000,800);
}


}
6 changes: 6 additions & 0 deletions TapMonster/src/MonsterDex/MonsterGraphic.java
@@ -1,5 +1,6 @@
package MonsterDex;

import guiPractice.components.Action;
import guiPractice.components.Graphic;

public class MonsterGraphic extends Graphic{
Expand All @@ -22,6 +23,11 @@ private static String randInt() {
return Integer.toString((int)(Math.random()*10));
}

public void act() {
// TODO Auto-generated method stub

}



}
2 changes: 2 additions & 0 deletions TapMonster/src/main/InventoryScreen.java
Expand Up @@ -70,6 +70,8 @@ public void initObjects(ArrayList<Visible> viewObjects) {

//each artifact has a name and description
//shows how many artifacts are collected
//can make interface for adding "you gained +something" for
//every artifact that is collected in the inventory

@Override
public void initAllObjects(List<Visible> viewObjects) {
Expand Down
15 changes: 0 additions & 15 deletions TapMonster/src/main/Monster.java

This file was deleted.

41 changes: 0 additions & 41 deletions TapMonster/src/main/MonsterDex.java

This file was deleted.

0 comments on commit 5b3462f

Please sign in to comment.