Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GameDevWeek
Sommersemester 2019
Cpp
PhaseShifter
Commits
dcf5cafe
Commit
dcf5cafe
authored
Sep 17, 2019
by
Georg Schäfer
Browse files
Add dummy floor tile.
parent
b649bab5
Pipeline
#3234
passed with stage
in 2 minutes and 20 seconds
Changes
12
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
assets/game_assets/blueprints/dummy_ceiling.json
0 → 100644
View file @
dcf5cafe
{
"Transform"
:
{
"scale"
:
{
"x"
:
0.5
,
"y"
:
0.5
,
"z"
:
0.5
}
},
"Model"
:
{
"aid"
:
"model:dummy_floor"
}
}
assets/game_assets/blueprints/dummy_floor.json
0 → 100644
View file @
dcf5cafe
{
"Transform"
:
{
"scale"
:
{
"x"
:
2.0
,
"y"
:
2.0
,
"z"
:
2.0
}
},
"Model"
:
{
"aid"
:
"model:dummy_floor"
},
"Shadowcaster"
:
{}
}
assets/game_assets/level/dummy.lvl
View file @
dcf5cafe
dummy
##############################
###---------##################
###| |##################
###| p |##################
###| |##################
###| x |##################
###---- ----##################
######| |#####################
######| |#####################
######| |#####################
###---- -----------###########
###| |###########
###| |###########
###| y |###########
###----------------###########
##############################
##############################
##############################
##############################
##############################
##############################
##############################
##############################
##############################
##############################
##############################
##############################
##############################
##############################
##############################
assets/game_assets/materials/dummy_floor_none.001.msf
0 → 100644
View file @
dcf5cafe
{
"substance_id": "default",
"albedo_aid": "dummy_floor_none.001_albedo.ktx",
"normal_aid": "dummy_floor_none.001_normal.ktx",
"brdf_aid": "dummy_floor_none.001_brdf.ktx",
"emission_aid": ""
}
assets/game_assets/models/dummy_floor.mmf
0 → 100644
LFS
View file @
dcf5cafe
File added
assets/game_assets/textures/dummy_floor_none.001_albedo.ktx
0 → 100644
LFS
View file @
dcf5cafe
File added
assets/game_assets/textures/dummy_floor_none.001_brdf.ktx
0 → 100644
LFS
View file @
dcf5cafe
File added
assets/game_assets/textures/dummy_floor_none.001_normal.ktx
0 → 100644
LFS
View file @
dcf5cafe
File added
assets/game_assets/tilesets/dummy.json
View file @
dcf5cafe
{
"tile_size"
:
1
,
"tile_size"
:
4
,
"tiles"
:
{
"|"
:
{
"blueprint"
:
"dummy_wall_vertical"
,
...
...
@@ -16,6 +16,12 @@
"#"
:
{
"blueprint"
:
"dummy_ceiling"
,
"solid"
:
true
},
"p"
:
{
"blueprint"
:
"dummy_floor"
,
"solid"
:
false
,
"spawn"
:
true
,
"spawns"
:
"player"
}
}
}
src/level/level.hpp
View file @
dcf5cafe
...
...
@@ -9,10 +9,12 @@
namespace
phase_shifter
::
level
{
struct
Tile
{
std
::
string
blueprint
;
bool
solid
;
bool
solid
=
false
;
bool
spawn
=
false
;
std
::
string
spawns
;
};
sf2_structDef
(
Tile
,
blueprint
,
solid
);
sf2_structDef
(
Tile
,
blueprint
,
solid
,
spawn
,
spawns
);
struct
Tileset
{
float
tile_size
;
...
...
src/level/level_system.cpp
View file @
dcf5cafe
...
...
@@ -14,12 +14,15 @@ namespace phase_shifter::level {
auto
&
level
=
_current_level
.
get_blocking
();
auto
&
tiles
=
level
.
_tileset
->
tiles
;
auto
offset
=
level
.
_tileset
->
tile_size
/
2.
f
;
glm
::
vec3
position
;
glm
::
vec3
position
{
0.
f
}
;
for
(
auto
&&
row
:
level
.
_tiles
)
{
for
(
auto
&&
tile_key
:
row
)
{
if
(
auto
tile_it
=
tiles
.
find
(
std
::
string
(
1
,
tile_key
));
tile_it
!=
tiles
.
end
())
{
auto
&
tile
=
tile_it
->
second
;
_entities
.
entity_builder
(
tile
.
blueprint
).
position
(
position
).
create
();
if
(
tile
.
spawn
)
{
_entities
.
entity_builder
(
tile
.
spawns
).
position
(
position
).
create
();
}
position
.
x
+=
offset
;
}
}
...
...
src/meta_system.cpp
View file @
dcf5cafe
...
...
@@ -104,16 +104,6 @@ namespace phase_shifter {
.
create
();
entities
().
entity_builder
(
"player"
).
position
({
0
,
1
,
0
}).
create
();
entities
()
.
entity_builder
(
"cube"
)
.
position
({
0
,
0
,
0
})
.
post_create
([
=
](
ecs
::
Entity_facet
entity
)
{
entity
.
process
<
Transform_comp
>
([
&
](
auto
&
transform
)
{
transform
.
scale
=
glm
::
vec3
{
10.
f
,
0.01
f
,
10.
f
};
});
})
.
create
();
}
Meta_system
::~
Meta_system
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment