From 1f1e62ce07ac22baf4ba886b6430aebd8eb02907 Mon Sep 17 00:00:00 2001 From: John W Bojorquez Date: Sat, 25 Apr 2015 13:51:56 -0400 Subject: [PATCH] Updated instructions and StartScreen --- .../src/config/instructions.txt | 15 ++++++- MerchantRPGCSE2102/src/model/Object.java | 36 +++++++++++++++ .../src/view/StartScreenPanel.java | 45 +++++++++++++++++++ 3 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 MerchantRPGCSE2102/src/model/Object.java create mode 100644 MerchantRPGCSE2102/src/view/StartScreenPanel.java diff --git a/MerchantRPGCSE2102/src/config/instructions.txt b/MerchantRPGCSE2102/src/config/instructions.txt index 550cd0e..39a5676 100644 --- a/MerchantRPGCSE2102/src/config/instructions.txt +++ b/MerchantRPGCSE2102/src/config/instructions.txt @@ -1 +1,14 @@ -Testing Instructions file \ No newline at end of file +============= INSTRUCTIONS =============== + +-- Controls -- +- Use arrow keys for movement +- Use 'F' key to initiate a transaction when next to a merchant +- Use 'N' key to start a new day + +-- Game Information -- +- The objective is the earn as much money as you can buying and selling +- Merchants will buy and sell only specific items +- The prices of these items changes daily! Remember to buy low and sell high! +- Merchants only have a limited amount of cash, this increases over time +- You can only do a limited number of transactions before the shops close +- Remember, the moment you enter a transaction time passes. Prioritize! \ No newline at end of file diff --git a/MerchantRPGCSE2102/src/model/Object.java b/MerchantRPGCSE2102/src/model/Object.java new file mode 100644 index 0000000..a53239b --- /dev/null +++ b/MerchantRPGCSE2102/src/model/Object.java @@ -0,0 +1,36 @@ +package model; + +public class Object { + private int col, row; + private String name; + + public Object(int row, int col, String name) { + this.setCol(col); + this.setRow(row); + this.setName(name); + } + + public int getCol() { + return col; + } + + public void setCol(int col) { + this.col = col; + } + + public int getRow() { + return row; + } + + public void setRow(int row) { + this.row = row; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/MerchantRPGCSE2102/src/view/StartScreenPanel.java b/MerchantRPGCSE2102/src/view/StartScreenPanel.java new file mode 100644 index 0000000..03a4c74 --- /dev/null +++ b/MerchantRPGCSE2102/src/view/StartScreenPanel.java @@ -0,0 +1,45 @@ +package view; + +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.LayoutManager; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; + +import javax.imageio.ImageIO; +import javax.swing.JPanel; + +public class StartScreenPanel extends JPanel { + + private static final long serialVersionUID = 1L; + BufferedImage background = null; + + + StartScreenPanel(LayoutManager lm) { + super(lm); + background = loadImage("background.jpg"); + } + + @Override + public void paintComponent(Graphics g) { + super.paintComponent(g); + Graphics2D g2d = (Graphics2D) g; + g2d.drawImage(background, 0, 0, null); + + } + + public BufferedImage loadImage(String fileName) { + + BufferedImage image = null; + + try { + image = ImageIO.read(new File("src/images/" + fileName)); + } catch (IOException e) { + e.printStackTrace(); + } + + return image; + } + +}