-
-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathrl.cpp
More file actions
68 lines (49 loc) · 1.54 KB
/
Copy pathrl.cpp
File metadata and controls
68 lines (49 loc) · 1.54 KB
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
#define ASLIB_INCLUDE_DL
#include "AsLib.hpp"
//ダンジョンのサンプルプログラム
int32_t asMain()
{
MainControl mc(u8"Simple Counter", Pos2(560, 700));
//モンスター
std::vector<AsTexture> monster;
monster.push_back({ u8"Picture/ikari.png", 6, 4 });
AsTexture feri(u8"Picture/ikari.png", 6, 4);
AsTexture crystal1(u8"p/crystal1.png");
size_t dir_id = MOB_DOWN;
size_t move_id = MOB_STOP;
size_t count = 0;
constexpr Pos2 w_pos2(8, 8);
worldMap w(w_pos2);
bool is_w = true;
if (is_w) {
w.rand().randC(100); is_w = false;
w.col[0] = { 255,255,255,255 };
//w.col[32*64-1] = { 255,0,0,255 };
}
constexpr PosA4F pl2(7.5f, 8.5f, 1.0f, 1.0f);
static PosA4F pl(0.5f, 0.5f, 1.0f, 1.0f);
constexpr PosA4F map_p(0.0f, 0.0f, 5.0f, 10.0f);
AsMapView mv(map_p, 'y');
mv.setMap(w_pos2);
while (asLoop())
{
pl.y += mouseWheel();
constexpr float fps = 0.2f;
if (moveMobCross(fps, pl)) mobMoveSet(move_id, count);
else move_id = MOB_STOP;
//DxLib::clsDx();
//DxLib::printfDx("(%f,%f,%f,%f)", pl.x, pl.y, pl.w, pl.h);
if (asKeyUp()) dir_id = MOB_UP;
else if (asKeyDown()) dir_id = MOB_DOWN;
else if (asKeyLeft()) dir_id = MOB_LEFT;
else if (asKeyRight()) dir_id = MOB_RIGHT;
//マップ描画の中心をプレイヤーの位置にセット
mv.setMobView(pl);
mv.draw(&w.col[0]);
mv.draw(pl2, w_pos2, Color(0, 255, 0, 255));
mv.draw(PosA4F(5.5f, 5.5f, 1.0f, 1.0f), w_pos2, Color(0, 205, 50, 255));
mv.draw(PosA4F(0.5f, 0.5f, 1.0f, 1.0f), w_pos2, Color(0, 255, 0, 255));
mv.draw(pl, w_pos2, feri, mobMoveDirect(dir_id, move_id));
}
return 0;
}