aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2016-06-24 10:56:35 -0400
committerClyne Sullivan <tullivan99@gmail.com>2016-06-24 10:56:35 -0400
commitf4177a77ceff0e1cffb7e968f3d48497fcd2d45c (patch)
treefe4473d5d0a36035902f58dda2bae130c2650558
parent56d34b56e82821797bc97be7e36138057109f87e (diff)
dialog wrap fix, removed junk files
-rw-r--r--Goals.txt121
-rw-r--r--assets/player/maybeplayer.pngbin4146 -> 0 bytes
-rw-r--r--assets/player/player.pngbin543 -> 0 bytes
-rw-r--r--assets/player/player1.pngbin552 -> 0 bytes
-rw-r--r--assets/player/player2.pngbin557 -> 0 bytes
-rw-r--r--assets/style/classic/bg/bagels.jpgbin259847 -> 0 bytes
-rw-r--r--assets/style/classic/bg/bagels.pngbin1252347 -> 0 bytes
-rw-r--r--assets/style/classic/bg/bgb.pngbin2899454 -> 0 bytes
-rw-r--r--assets/style/classic/bg/bgfarMountains.pngbin30875 -> 0 bytes
-rw-r--r--assets/style/classic/bg/forestTileFront.pngbin32565 -> 5703 bytes
-rw-r--r--assets/style/rustic/bg/bgfarMountains.pngbin30875 -> 0 bytes
-rw-r--r--brice.dat4
-rw-r--r--src/entities.cpp2
-rw-r--r--src/ui.cpp27
-rw-r--r--storyXML/0000_SpawnHill.xml12
-rw-r--r--xcf/bgTrashWaves.xcfbin3932867 -> 0 bytes
-rw-r--r--xcf/bgWoodTile.xcfbin511349 -> 0 bytes
-rw-r--r--xcf/goodtree1.xcfbin0 -> 55512 bytes
-rw-r--r--xml/bobshouse.xml8
-rw-r--r--xml/playerSpawnHill1.xml6
-rw-r--r--xml/playerSpawnHill1_Building1.xml6
-rw-r--r--xml/town.xml8
-rw-r--r--xml/town.xml.save11
23 files changed, 27 insertions, 178 deletions
diff --git a/Goals.txt b/Goals.txt
deleted file mode 100644
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
index c580ff7..0000000
--- a/assets/player/maybeplayer.png
+++ /dev/null
Binary files differ
diff --git a/assets/player/player.png b/assets/player/player.png
deleted file mode 100644
index 3977092..0000000
--- a/assets/player/player.png
+++ /dev/null
Binary files differ
diff --git a/assets/player/player1.png b/assets/player/player1.png
deleted file mode 100644
index edf8bf8..0000000
--- a/assets/player/player1.png
+++ /dev/null
Binary files differ
diff --git a/assets/player/player2.png b/assets/player/player2.png
deleted file mode 100644
index cfd955f..0000000
--- a/assets/player/player2.png
+++ /dev/null
Binary files differ
diff --git a/assets/style/classic/bg/bagels.jpg b/assets/style/classic/bg/bagels.jpg
deleted file mode 100644
index fb68d2e..0000000
--- a/assets/style/classic/bg/bagels.jpg
+++ /dev/null
Binary files differ
diff --git a/assets/style/classic/bg/bagels.png b/assets/style/classic/bg/bagels.png
deleted file mode 100644
index 2ee843b..0000000
--- a/assets/style/classic/bg/bagels.png
+++ /dev/null
Binary files differ
diff --git a/assets/style/classic/bg/bgb.png b/assets/style/classic/bg/bgb.png
deleted file mode 100644
index 278e9b0..0000000
--- a/assets/style/classic/bg/bgb.png
+++ /dev/null
Binary files differ
diff --git a/assets/style/classic/bg/bgfarMountains.png b/assets/style/classic/bg/bgfarMountains.png
deleted file mode 100644
index fa6b349..0000000
--- a/assets/style/classic/bg/bgfarMountains.png
+++ /dev/null
Binary files differ
diff --git a/assets/style/classic/bg/forestTileFront.png b/assets/style/classic/bg/forestTileFront.png
index d81b2c7..1f5abb2 100644
--- a/assets/style/classic/bg/forestTileFront.png
+++ b/assets/style/classic/bg/forestTileFront.png
Binary files differ
diff --git a/assets/style/rustic/bg/bgfarMountains.png b/assets/style/rustic/bg/bgfarMountains.png
deleted file mode 100644
index fa6b349..0000000
--- a/assets/style/rustic/bg/bgfarMountains.png
+++ /dev/null
Binary files differ
diff --git a/brice.dat b/brice.dat
index 4dad711..3b090ad 100644
--- a/brice.dat
+++ b/brice.dat
@@ -1,7 +1,7 @@
3
-Slow
+canSprint
0
canJump
0
-canSprint
+Slow
1
diff --git a/src/entities.cpp b/src/entities.cpp
index cfc5922..60f49ee 100644
--- a/src/entities.cpp
+++ b/src/entities.cpp
@@ -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)
diff --git a/src/ui.cpp b/src/ui.cpp
index b484982..14df95e 100644
--- a/src/ui.cpp
+++ b/src/ui.cpp
@@ -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
index 7edd3b8..0000000
--- a/storyXML/0000_SpawnHill.xml
+++ /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
index 0214d8d..0000000
--- a/xcf/bgTrashWaves.xcf
+++ /dev/null
Binary files differ
diff --git a/xcf/bgWoodTile.xcf b/xcf/bgWoodTile.xcf
deleted file mode 100644
index 867e556..0000000
--- a/xcf/bgWoodTile.xcf
+++ /dev/null
Binary files differ
diff --git a/xcf/goodtree1.xcf b/xcf/goodtree1.xcf
new file mode 100644
index 0000000..861cbf0
--- /dev/null
+++ b/xcf/goodtree1.xcf
Binary files differ
diff --git a/xml/bobshouse.xml b/xml/bobshouse.xml
index 2e7e576..32e6a95 100644
--- a/xml/bobshouse.xml
+++ b/xml/bobshouse.xml
@@ -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">
diff --git a/xml/playerSpawnHill1.xml b/xml/playerSpawnHill1.xml
index afd4898..e052c50 100644
--- a/xml/playerSpawnHill1.xml
+++ b/xml/playerSpawnHill1.xml
@@ -16,11 +16,11 @@
<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>
diff --git a/xml/playerSpawnHill1_Building1.xml b/xml/playerSpawnHill1_Building1.xml
index 7c69919..28add1f 100644
--- a/xml/playerSpawnHill1_Building1.xml
+++ b/xml/playerSpawnHill1_Building1.xml
@@ -10,17 +10,17 @@
<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>
diff --git a/xml/town.xml b/xml/town.xml
index b6f17de..32e6a95 100644
--- a/xml/town.xml
+++ b/xml/town.xml
@@ -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
index 4800462..0000000
--- a/xml/town.xml.save
+++ /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>