aboutsummaryrefslogtreecommitdiffstats
path: root/src/entities.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2016-04-04 14:54:21 -0400
committerClyne Sullivan <tullivan99@gmail.com>2016-04-04 14:54:21 -0400
commita7bbe5cc18fe5b24f5d97d4acce164998d8d5517 (patch)
tree8ef8f0ce2303bbd0aef68c66e7687ec3ca216d30 /src/entities.cpp
parentc74d256646cf0c438feee2ac703cc1f34b47b8ec (diff)
physics, removed extra couts
Diffstat (limited to 'src/entities.cpp')
-rw-r--r--src/entities.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/entities.cpp b/src/entities.cpp
index f4e2dd7..bea2117 100644
--- a/src/entities.cpp
+++ b/src/entities.cpp
@@ -75,6 +75,7 @@ void Entity::spawn(float x, float y){ //spawns the entity you pass to it based o
loc.y = y;
vel.x = 0;
vel.y = 0;
+ targetx = 0.9112001f;
alive = true;
right = true;
@@ -407,6 +408,13 @@ wander( int timeRun )
direction = 0;
vel.x = .018 * HLINE * direction;
+ } else if ( targetx != 0.9112001f ) {
+ if ( loc.x > targetx + HLINE * 5)
+ vel.x = -0.018 * HLINE;
+ else if ( loc.x < targetx - HLINE * 5)
+ vel.x = 0.018 * HLINE;
+ else
+ targetx = 0.9112001f;
} else if ( ticksToUse == 0 ) {
ticksToUse = timeRun;
@@ -489,21 +497,17 @@ void Merchant::interact(){
ui::merchantBox(name, trade[currTrade], ":Accept:Good-Bye", false, "Welcome to Smithy\'s. Buy your sausages here you freaking meme lording screw-face");
ui::waitForDialog();
if(ui::dialogOptChosen == 1){
- std::cout << "Gimme ye' munny" << std::endl;
if(!(player->inv->takeItem(trade[currTrade].item[1],trade[currTrade].quantity[1])))
player->inv->addItem(trade[currTrade].item[0],trade[currTrade].quantity[0]);
}else if(ui::dialogOptChosen == 2){
- std::cout << "See ye!" << std::endl;
}else if(ui::merchOptChosen == 1){
if(currTrade != 0){
currTrade--;
- std::cout << "Last trade" << std::endl;
interact();
}
}else if(ui::merchOptChosen == 2){
if(currTrade < trade.size()){
currTrade++;
- std::cout << "Next trade" << std::endl;
interact();
}
}