]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
dialog wrap fix, removed junk files
authorClyne Sullivan <tullivan99@gmail.com>
Fri, 24 Jun 2016 14:56:35 +0000 (10:56 -0400)
committerClyne Sullivan <tullivan99@gmail.com>
Fri, 24 Jun 2016 14:56:35 +0000 (10:56 -0400)
23 files changed:
Goals.txt [deleted file]
assets/player/maybeplayer.png [deleted file]
assets/player/player.png [deleted file]
assets/player/player1.png [deleted file]
assets/player/player2.png [deleted file]
assets/style/classic/bg/bagels.jpg [deleted file]
assets/style/classic/bg/bagels.png [deleted file]
assets/style/classic/bg/bgb.png [deleted file]
assets/style/classic/bg/bgfarMountains.png [deleted file]
assets/style/classic/bg/forestTileFront.png
assets/style/rustic/bg/bgfarMountains.png [deleted file]
brice.dat
src/entities.cpp
src/ui.cpp
storyXML/0000_SpawnHill.xml [deleted file]
xcf/bgTrashWaves.xcf [deleted file]
xcf/bgWoodTile.xcf [deleted file]
xcf/goodtree1.xcf [new file with mode: 0644]
xml/bobshouse.xml
xml/playerSpawnHill1.xml
xml/playerSpawnHill1_Building1.xml
xml/town.xml
xml/town.xml.save [deleted file]

diff --git a/Goals.txt b/Goals.txt
deleted file mode 100644 (file)
index 4848bac..0000000
--- a/Goals.txt
+++ /dev/null
@@ -1,121 +0,0 @@
-Goals:
-
-End of October:
-===============
-
-       - have textures for the world and entities (png's and stuff)
-       - have basic quest handling/player can interact with NPCs to take quests
-       - have basic mobs/animals
-       
-Summary:
-       NPCs and a village were created, and a basic quest handling structure was design so that
-the player could accept and complete quests from NPCs. Next we developed textures for the player,
-NPCs, house and background, using PNG loading from SDL_image. After that, Andy began to work on
-more textures for the game as well as animations for the player while Clyne worked on a player
-inventory and rewarding items from quest completions. While these were (are) still in development
-Andy added a basic template for mobs.
-
-End of November:
-================
-
-       - design the game
-       - work on GLSL shaders to replace the current 'fake' ones
-       - redesign what currently exists to match what is desired
-
-Summary:
-       Textures have been formalized, with a namespace and class for loading and using textures. The
-idea of a parallaxed background was applied, with up to four layers of tiled background material.
-Combinations of background layers were sorted and added to the World class with a World::setBackground()
-function. The inventory was created, with an animated inventory view based off of the player finished
-by the end of the month. ...
-
-End of December:
-================
-
-       - create first 'chapters' of story
-       - create very first areas in the game (code it) to get an
-         idea of what's gonna go down
-
-January - March:
-===============
-
-       - design more story line...
-       - implement story line
-
-February - End of March:
-========================
-
-       - design or focus on sound effects / background music?
-       
-March-ish:
-======
-
-       - allow friends to beta-test game
-       - modify game according to feedback
-       
-April:
-====
-
-       - remove any remaining bugs in game
-       - get more testing done...
-       - look into methods of releasing the game (steam)
-       
-May:
-====
-
-       - release game
-       
-June:
-=====
-
-       - profit????
-
-
-********************************************************************************************************
-********************************************************************************************************
-Goals.txt before redesign:
-********************************************************************************************************
-********************************************************************************************************
-
-End of November:
-================
-
-       - have a working player inventory
-       - receive items from things like quests and mobs
-       - weapons n stuff
-
-End of December:
-================
-
-       - have a basic world scripter thing to script worlds
-       - create world saving/loading functionality
-         (maybe work on prettying up inventory/save-load/quest stuff)
-
-January - February:
-===================
-
-       - work on a story line
-       
-February - March:
-=================
-
-       - work on sound effects / background music
-
-End of March:
-=============
-
-       - Have game ready to be beta-tested by friends/other people so we can work
-         on receiving bug reports/adding things testers expect to have in the game.
-         
-End of April:
-=============
-
-       - Have all major bugs found by beta testers removed/fixed
-       - Have the game ready for release to the public (during May the game should
-         be released in some form)
-
-End of May:
-===========
-
-       - Have game fully deployed with a way to receive feedback from the players
-       
diff --git a/assets/player/maybeplayer.png b/assets/player/maybeplayer.png
deleted file mode 100644 (file)
index c580ff7..0000000
Binary files a/assets/player/maybeplayer.png and /dev/null differ
diff --git a/assets/player/player.png b/assets/player/player.png
deleted file mode 100644 (file)
index 3977092..0000000
Binary files a/assets/player/player.png and /dev/null differ
diff --git a/assets/player/player1.png b/assets/player/player1.png
deleted file mode 100644 (file)
index edf8bf8..0000000
Binary files a/assets/player/player1.png and /dev/null differ
diff --git a/assets/player/player2.png b/assets/player/player2.png
deleted file mode 100644 (file)
index cfd955f..0000000
Binary files a/assets/player/player2.png and /dev/null differ
diff --git a/assets/style/classic/bg/bagels.jpg b/assets/style/classic/bg/bagels.jpg
deleted file mode 100644 (file)
index fb68d2e..0000000
Binary files a/assets/style/classic/bg/bagels.jpg and /dev/null differ
diff --git a/assets/style/classic/bg/bagels.png b/assets/style/classic/bg/bagels.png
deleted file mode 100644 (file)
index 2ee843b..0000000
Binary files a/assets/style/classic/bg/bagels.png and /dev/null differ
diff --git a/assets/style/classic/bg/bgb.png b/assets/style/classic/bg/bgb.png
deleted file mode 100644 (file)
index 278e9b0..0000000
Binary files a/assets/style/classic/bg/bgb.png and /dev/null differ
diff --git a/assets/style/classic/bg/bgfarMountains.png b/assets/style/classic/bg/bgfarMountains.png
deleted file mode 100644 (file)
index fa6b349..0000000
Binary files a/assets/style/classic/bg/bgfarMountains.png and /dev/null differ
index d81b2c77aa1b2d56f35a02c1500cea558829d695..1f5abb2746f3f62ae1a1ab943e9fd688ff99388b 100644 (file)
Binary files a/assets/style/classic/bg/forestTileFront.png and b/assets/style/classic/bg/forestTileFront.png differ
diff --git a/assets/style/rustic/bg/bgfarMountains.png b/assets/style/rustic/bg/bgfarMountains.png
deleted file mode 100644 (file)
index fa6b349..0000000
Binary files a/assets/style/rustic/bg/bgfarMountains.png and /dev/null differ
index 4dad7115c21edf220ed1e407b1d7f9f20b430ea0..3b090ad887b4d2aa51cf2d99adc0eeaf055a2798 100644 (file)
--- a/brice.dat
+++ b/brice.dat
@@ -1,7 +1,7 @@
 3
-Slow
+canSprint
 0
 canJump
 0
-canSprint
+Slow
 1
index cfc592258c65de7fad5ff067a255e1d246cbffa4..60f49ee06456822695d10ed1f19acb9842e42dd0 100644 (file)
@@ -679,7 +679,6 @@ COMMONAIFUNC:
                                        break;
                        } while ((exml = exml->NextSiblingElement()));
 
-                       std::cout << "b\n";
                        // handle quest tags
                        if ((oxml = exml->FirstChildElement("quest"))) {
                                std::string qname;
@@ -733,7 +732,6 @@ COMMONAIFUNC:
                                game::briceUpdate();
                        }
 
-                       std::cout << "a\n";
                        // asdlfkj
                        auto txml = exml->FirstChildElement("content");
                        if (txml == nullptr)
index b4849826c3922e266453138eddb1eeb44113e456..14df95eff85361e3ab84743f3cbe6fd21fa8b978 100644 (file)
@@ -178,7 +178,7 @@ namespace ui {
        unsigned char dialogOptChosen = 0;
        unsigned char merchOptChosen = 0;
 
-       unsigned int textWrapLimit = 110;
+       unsigned int textWrapLimit = 0;
 
        /*
         *      Current font size. Changing this WILL NOT change the font size, see setFontSize() for
@@ -363,24 +363,19 @@ namespace ui {
        */
 
        float putString(const float x, const float y, std::string s) {
-               unsigned int i=0;
+               unsigned int i = 0, nl = 1;
                vec2 add, o = {x, y};
 
                /*
-                *      Loop on each character:
-               */
+                * Loop on each character:
+                */
 
-               do{
-                       if (i && ((i / 110.0) == (i / 110))) {
-                               o.y -= fontSize * 1.05f;
-                               o.x = x;
-                               if (s[i] == ' ')
-                                       i++;
-                       }
+               do {
+                       if (dialogBoxExists && o.x > textWrapLimit * nl + x) {
 
-                       if (i && (i / (float)textWrapLimit == i / textWrapLimit)) {
                                o.y -= fontSize * 1.05f;
                                o.x = x;
+                               ++nl;
 
                                // skip a space if it's there since we just newline'd
                                if (s[i] == ' ')
@@ -408,8 +403,7 @@ namespace ui {
                                o.y += add.y;
                                break;
                        }
-
-               }while(s[++i]);
+               } while (s[++i]);
 
                return o.x;     // i.e. the string width
        }
@@ -537,7 +531,8 @@ namespace ui {
                va_list dialogArgs;
                std::unique_ptr<char[]> printfbuf (new char[512]);
 
-               textWrapLimit = 110;
+               textWrapLimit = game::SCREEN_WIDTH - HLINES(20);
+               std::cout << textWrapLimit << '\n';     
                dialogPassive = passive;
 
                // add speaker prefix
@@ -1093,7 +1088,7 @@ namespace ui {
                                drawNiceBox(vec2 {x, y}, vec2 {x + SCREEN_WIDTH - HLINES(16), y - SCREEN_HEIGHT / 4}, -7.0);
 
                                rtext = typeOut(dialogBoxText);
-                               putString(x + (2*game::HLINE), y - fontSize - game::HLINE, rtext);
+                               putString(x + HLINES(2), y - fontSize - game::HLINE, rtext);
 
                                for(i=0;i<dialogOptText.size();i++) {
                                        setFontColor(255,255,255);
diff --git a/storyXML/0000_SpawnHill.xml b/storyXML/0000_SpawnHill.xml
deleted file mode 100644 (file)
index 7edd3b8..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0"?>
-<World>
-
-       <style background="0" bgm="assets/music/embark.wav" folder="assets/style/farming/" />
-       <generation type="Random" width="500" />
-       <time>12000</time>
-
-       <hill peakx="0" peaky="1000" width="75" />
-
-       <structure type="0" x="-300" texture="assets/style/farming/farmHouse.png"/>
-
-</World>
diff --git a/xcf/bgTrashWaves.xcf b/xcf/bgTrashWaves.xcf
deleted file mode 100644 (file)
index 0214d8d..0000000
Binary files a/xcf/bgTrashWaves.xcf and /dev/null differ
diff --git a/xcf/bgWoodTile.xcf b/xcf/bgWoodTile.xcf
deleted file mode 100644 (file)
index 867e556..0000000
Binary files a/xcf/bgWoodTile.xcf and /dev/null differ
diff --git a/xcf/goodtree1.xcf b/xcf/goodtree1.xcf
new file mode 100644 (file)
index 0000000..861cbf0
Binary files /dev/null and b/xcf/goodtree1.xcf differ
index 2e7e576fc57de4bc0e65a8164e5a56c9cfe754c7..32e6a95a70c85120317fee0148657c8b6da6858f 100644 (file)
@@ -4,10 +4,10 @@
     <generation type="Random" width="1600"/>
     <time>6000</time>
     <spawnx>-300</spawnx>
-    <npc name="Sanc" hasDialog="true" health="1" x="607.58258" y="68.099052" dindex="9999"/>
-    <npc name="Bob" hasDialog="true" spawnx="30" health="1" x="-117.91962" y="63.499046" dindex="9999"/>
-    <structure type="1" spawnx="300" alive="1"/>
-    <structure inside="bobshouse.xml" type="1" spawnx="10" alive="1"/>
+    <npc name="Sanc" hasDialog="true"/>
+    <npc name="Bob" hasDialog="true" spawnx="30"/>
+    <structure type="1" spawnx="300"/>
+    <structure inside="bobshouse.xml" type="1" spawnx="10"/>
 </World>
 
 <Dialog name="Bob">
index afd489821cb91dce4872322ada0ae51e3ba6e81a..e052c50bca1e4219de0ad89f52f19241091260ba 100644 (file)
 <Dialog name="Guy">
     <text id="0" nextid="1">
                Hello there! My name is Ralph.
-                                                                                                                                                                                                                                                                                                                                                                                                                                                       <gotox>300</gotox>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       <gotox>300</gotox>
     </text>
     <text id="1">
                ...
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       <gotox>1000</gotox>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       <gotox>1000</gotox>
         <set id="Slow" value="0"/>
         <set id="canSprint" value="1"/>
     </text>
@@ -33,5 +33,5 @@
     <text id="0" stop="true">
                Hey friend! It's dangerous out there, here take these!
                Wait, promise you'll stop by my stand in the local market!
-                                                                                                                                                                                                                                                                                                                                                                                                                                                       <give id="Wood Sword" count="1"/>        <give id="Hunters Bow" count="1"/>        <give id="Crude Arrow" count="110"/>        <give id="Fried Chicken" count="1"/>        <give id="Mossy Torch" count="1"/></text>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       <give id="Wood Sword" count="1"/>        <give id="Hunters Bow" count="1"/>        <give id="Crude Arrow" count="110"/>        <give id="Fried Chicken" count="1"/>        <give id="Mossy Torch" count="1"/></text>
 </Dialog>
index 7c69919d2b6c465e150f92c68e414993302dee0b..28add1f8aa0e7073605f0830c04bc064db530ace 100644 (file)
 <Dialog name="Bob">
     <text id="0" nextid="1" pause="true">
        Hey. Have a Dank MayMay :)
-                                                                                                                                                                                                                       <give id="Dank MayMay" count="1"/></text>
+                                                                                                                                                                                                                                                                                                                                       <give id="Dank MayMay" count="1"/></text>
     <text id="1" nextid="2">
        What? You want another Dank MayMay?
     </text>
     <text id="2" nextid="3" pause="true">
                K.
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   <give id="Dank MayMay" count="1"/></text>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   <give id="Dank MayMay" count="1"/></text>
     <text id="3" nextid="4">
                Well... I'm out of Dank MayMays.
        </text>
     <text id="4">
                Have a sword though.
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               <give id="Wood Sword" count="1"/></text>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               <give id="Wood Sword" count="1"/></text>
 </Dialog>
index b6f17def087841827e08d669b6d07bb45a4a4b5e..32e6a95a70c85120317fee0148657c8b6da6858f 100644 (file)
@@ -4,10 +4,10 @@
     <generation type="Random" width="1600"/>
     <time>6000</time>
     <spawnx>-300</spawnx>
-    <npc name="Sanc" hasDialog="true" health="1" x="648.92395" y="68.298882" dindex="9999"/>
-    <npc name="Bob" hasDialog="true" spawnx="30" health="1" x="-159.27541" y="65.598969" dindex="9999"/>
-    <structure type="1" spawnx="300" alive="1"/>
-    <structure inside="bobshouse.xml" type="1" spawnx="10" alive="1"/>
+    <npc name="Sanc" hasDialog="true"/>
+    <npc name="Bob" hasDialog="true" spawnx="30"/>
+    <structure type="1" spawnx="300"/>
+    <structure inside="bobshouse.xml" type="1" spawnx="10"/>
 </World>
 
 <Dialog name="Bob">
diff --git a/xml/town.xml.save b/xml/town.xml.save
deleted file mode 100644 (file)
index 4800462..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0"?>
-<World>
-    <style background="0" bgm="assets/music/embark.wav" folder="assets/style/classic/"/>
-    <generation type="Random" width="1600"/>
-    <time>6000</time>
-    <spawnx>-300</spawnx>
-    <npc name="Sanc" hasDialog="true"/>
-    <npc name="Bob" hasDialog="true"/>
-    <structure type="1" spawnx="300"/>
-    <structure type="1" spawnx="10"/>
-</World>