-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathso_scene_shop.cpp
79 lines (74 loc) · 2.57 KB
/
so_scene_shop.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#include "so_scene_shop.h"
#include "bn_core.h"
#include "bn_log.h"
#include "bn_keypad.h"
#include "bn_string.h"
#include "bn_fixed_point.h"
#include "bn_sprite_ptr.h"
#include "bn_camera_ptr.h"
#include "bn_regular_bg_ptr.h"
#include "bn_optional.h"
#include "bn_span.h"
#include "bn_affine_bg_map_cell.h"
#include "bn_display.h"
#include "bn_sprite_font.h"
#include "bn_rect_window.h"
#include "bn_camera_actions.h"
#include "bn_regular_bg_items_haha_house.h"
#include "so_player.h"
#include "so_scene_type.h"
#include "so_npc.h"
#include "so_npc_type.h"
#include "so_dialogue_scene.h"
#include "so_item.h"
#include "bn_sound_items.h"
#include "bn_sound_items_info.h"
#include "bn_sound_actions.h"
/* #include "bn_affine_bg_big_map_canvas_size.h"
#include "bn_affine_bg_pa_register_hbe_ptr.h"
#include "bn_affine_bg_pd_register_hbe_ptr.h"
#include "bn_affine_bg_dx_register_hbe_ptr.h"
#include "bn_affine_bg_dy_register_hbe_ptr.h" */
namespace so
{
Shop::Shop(Player& player)
: _player(&player) {}
Scene Shop::execute() //bn::fixed_point spawn_location
{
//Scrolling map based on cameras from examples
bn::regular_bg_ptr haha_house_bg = bn::regular_bg_items::haha_house.create_bg(0, 0);
bn::camera_ptr camera = bn::camera_ptr::create(0, 0);
haha_house_bg.set_camera(camera);
while(camera.x() < 100) {
camera.set_x(camera.x() + 2);
bn::core::update();
}
Npc sook = Npc(-16, 16, NPC_TYPE::SOOK);
bn::core::update();
bn::sprite_text_generator text_generator(common::variable_8x8_sprite_font);
dialogue_scene(text_generator, "Anyone to home?");
bn::core::update();
dialogue_scene(text_generator, "What do you want with Haha?");
bn::core::update();
Item purse = Item(10, 0, ITEM_TYPE::PURSE);
bn::core::update();
while(purse.pos().y() > -15) {
purse.set_pos(bn::fixed_point(purse.pos().x(), purse.pos().y() - 1));
bn::core::update();
}
while(purse.pos().y() < 0) {
purse.set_pos(bn::fixed_point(purse.pos().x(), purse.pos().y() + 1));
bn::core::update();
}
bn::core::update();
bn::sound_items::cap.play(0.95);
purse.set_visible(false);
dialogue_scene(text_generator, "Tell you what.");
bn::core::update();
dialogue_scene(text_generator, "Send me one of the fruitcakes instead.");
bn::core::update();
//Haha's sprite and more dialogue here
//Next scene is stove OR the next day
return Scene::NEXTDAY;
}
}