package Zyun.Lam.Game.MonsterQuest;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Font;
import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;
import java.awt.Graphics2D;
import java.awt.geom.GeneralPath;

class gamePart1__Tutorial {
    static String textsStrings [] = {"Press Space to continue...", "Hello, I am a villager from Newbies Town!", "Welcome to Monster Quest.", "We live, in a beautiful place.", "But, monsters have come out from nowhere,", "Killing us all.", "Many brave souls ventured out to rid the monsters,", "But none came back.", "Help us all, my dear friend", "And save us all!"};
    static int wordToShow = 0;
    static void drawImage (java.awt.Graphics g) {
        BufferedImage villagerImage = null;
        try {
            villagerImage = ImageIO.read(new File ("D:\\Zyun's Coding\\My Coding\\Monster Quest\\src\\Zyun\\Lam\\Game\\MonsterQuest\\resources\\villagerimg.png"));
            g.drawImage(villagerImage, 0, 0, null);
            textBox(g);
            drawWords(g, wordToShow);
        } catch (Exception e) {
        }
    }
    static void textBox (java.awt.Graphics g) {
        Graphics2D g2d = (java.awt.Graphics2D) g;
        GeneralPath txtbox = new GeneralPath();
        txtbox.moveTo(650, 340);
        txtbox.lineTo(746, 280);
        txtbox.lineTo(1172, 280);
        txtbox.lineTo(1172, 42);
        txtbox.lineTo(321, 42);
        txtbox.lineTo(319, 280);
        txtbox.lineTo(650, 288);
        txtbox.closePath();
        BasicStroke s = new BasicStroke(5.5f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
        g2d.setStroke(s);
        g2d.setStroke(new BasicStroke(3));
        g2d.setColor(Color.BLACK);
        g2d.draw(txtbox);
        g2d.setColor(Color.WHITE);
        g2d.fill(txtbox);
    }
    
    static void drawWords (java.awt.Graphics g, int textToShow) {
        Graphics2D g2d = (Graphics2D) g;
        Font fontToShow = new Font ("Curlz MT", Font.PLAIN, 30);
        g2d.setFont(fontToShow);
        g2d.setColor(Color.BLACK);
        g2d.drawString(textsStrings[textToShow], 350, 100);
        System.out.println("Showing font...");
    }
}
@@ -263,16 +263,45 @@
 alPath;%0D
+%0Aimport java.io.IOException;%0D
 %0A%0D%0Aclass
@@ -320,24 +320,80 @@
 Tutorial %7B%0D%0A
+    //The strings of what the villager is about to say%0D%0A
     static S
@@ -443,24 +443,34 @@
 ntinue...%22, 
+%0D%0A        
 %22Hello, I am
@@ -502,16 +502,26 @@
 Town!%22, 
+%0D%0A        
 %22Welcome
@@ -541,16 +541,26 @@
 uest.%22, 
+%0D%0A        
 %22We live
@@ -585,16 +585,26 @@
 lace.%22, 
+%0D%0A        
 %22But, mo
@@ -640,16 +640,26 @@
 here,%22, 
+%0D%0A        
 %22Killing
@@ -669,16 +669,26 @@
  all.%22, 
+%0D%0A        
 %22Many br
@@ -733,16 +733,26 @@
 ters,%22, 
+%0D%0A        
 %22But non
@@ -766,16 +766,26 @@
 back.%22, 
+%0D%0A        
 %22Help us
@@ -807,16 +807,26 @@
 riend%22, 
+%0D%0A        
 %22And sav
@@ -839,10 +839,159 @@
 ll!%22
-%7D;
+, %0D%0A        %22Let's get into some important things.%22, %0D%0A        %22What is your name?%22%7D;%0D%0A    //The word to show -- Will be used in the textsStrings array
 %0D%0A  
@@ -1063,32 +1063,62 @@
 .Graphics g) %7B%0D%0A
+        //The image variable%0D%0A
         Buffered
@@ -1177,129 +1177,160 @@
     
-villagerImage = ImageIO.read(new File (%22D:%5C%5CZyun's Coding%5C%5CMy Coding%5C%5CMonster Quest%5C%5Csrc%5C%5CZyun%5C%5CLam%5C%5CGame%5C%5CMonsterQuest%5C%5C
+//Retrive Image from hash map%0D%0A            //TODO%0D%0A            //show image%0D%0A            villagerImage = ImageIO.read(new File (WindowMain.user_dir + %22/
 reso
@@ -1338,10 +1338,9 @@
 rces
-%5C%5C
+/
 vill
@@ -1490,16 +1490,18 @@
  catch (
+IO
 Exceptio
@@ -1504,24 +1504,171 @@
 ption e) %7B%0D%0A
+            System.err.println(%22Unable to open image: %22 + e.getMessage());%0D%0A            SystemLog.log(%22Unable to open Image: %22 + e.getMessage());%0D%0A
         %7D%0D%0A 
@@ -2740,24 +2740,118 @@
 ing 
-font...%22);%0D%0A    %7D%0D%0A%7D
+text for villager speech...%22);%0D%0A    %7D%0D%0A    %0D%0A    static void getName (java.awt.Graphics g) %7B%0D%0A        %0D%0A    %7D%0D%0A%7D%0D%0A

Update gamePart1__Tutorial.java