Skip to content

Commit 7604952

Browse files
committed
feat: add new assets for bullets, drones, and monsters; update app configuration and collision layers
1 parent 1c9042a commit 7604952

8 files changed

Lines changed: 79 additions & 126 deletions

File tree

assets/gltf/bullet/bullet.glb

2.16 MB
Binary file not shown.

assets/gltf/drone/arcade_corki.glb

1.61 MB
Binary file not shown.

assets/gltf/monster/drmundo.glb

10.3 MB
Binary file not shown.

assets/sounds/gun_shot.wav

103 KB
Binary file not shown.

assets/sounds/gun_shot_2.mp3

44.1 KB
Binary file not shown.

config/app.jsonc

Lines changed: 77 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"width": 1280,
77
"height": 720
88
},
9-
"fullscreen": false
9+
"fullscreen": true
1010
},
1111
"scene": {
1212
"renderer": {
@@ -41,6 +41,10 @@
4141
"plane": "assets/models/plane.obj",
4242
"sphere": "assets/models/sphere.obj"
4343
},
44+
"sounds": {
45+
"gunshot-player": "assets/sounds/gun_shot.wav",
46+
"gunshot-enemy": "assets/sounds/gun_shot_2.wav"
47+
},
4448
"samplers": {
4549
"default": {},
4650
"pixelated": {
@@ -55,64 +59,10 @@
5559
}
5660
},
5761
"materials": {
58-
"ground": {
59-
"type": "textured",
60-
"shader": "textured",
61-
"pipelineState": {
62-
"faceCulling": {
63-
"enabled": false
64-
},
65-
"depthTesting": {
66-
"enabled": true
67-
}
68-
},
69-
"tint": [1.0, 1.0, 1.0, 1.0],
70-
"texture": "grass",
71-
"sampler": "ground_tiled",
72-
"uvScale": [96.0, 96.0]
73-
},
74-
"drone": {
75-
"type": "tinted",
76-
"shader": "tinted",
77-
"pipelineState": {
78-
"faceCulling": {
79-
"enabled": false
80-
},
81-
"depthTesting": {
82-
"enabled": true
83-
}
84-
},
85-
"tint": [0.85, 0.9, 1.0, 1.0]
86-
},
87-
"monster": {
88-
"type": "tinted",
89-
"shader": "tinted",
90-
"pipelineState": {
91-
"faceCulling": {
92-
"enabled": false
93-
},
94-
"depthTesting": {
95-
"enabled": true
96-
}
97-
},
98-
"tint": [1.0, 1.0, 1.0, 1.0]
99-
},
100-
"metal": {
101-
"type": "tinted",
102-
"shader": "tinted",
103-
"pipelineState": {
104-
"faceCulling": {
105-
"enabled": false
106-
},
107-
"depthTesting": {
108-
"enabled": true
109-
}
110-
},
111-
"tint": [0.45, 0.4, 0.5, 1.0]
112-
},
113-
"glass": {
114-
"type": "textured",
115-
"shader": "textured",
62+
"projectile-player": {
63+
"type": "lit",
64+
"shader": "lit",
65+
"transparent": true,
11666
"pipelineState": {
11767
"faceCulling": {
11868
"enabled": false
@@ -123,63 +73,48 @@
12373
"blending": {
12474
"enabled": true,
12575
"sourceFactor": "GL_SRC_ALPHA",
126-
"destinationFactor": "GL_ONE_MINUS_SRC_ALPHA"
76+
"destinationFactor": "GL_ONE"
12777
},
12878
"depthMask": false
12979
},
130-
"transparent": true,
131-
"tint": [1.0, 1.0, 1.0, 1.0],
132-
"texture": "glass",
133-
"sampler": "pixelated"
80+
"sampler": "default",
81+
"tint": [1.0, 0.95, 0.84, 0.92],
82+
"albedo": [1.0, 0.88, 0.62],
83+
"metallic": 0.0,
84+
"roughness": 0.12,
85+
"ambientOcclusion": 1.0,
86+
"emission": [6.0, 3.8, 1.2]
13487
},
135-
"grass": {
136-
"type": "textured",
137-
"shader": "textured",
138-
"pipelineState": {
139-
"faceCulling": {
140-
"enabled": false
141-
},
142-
"depthTesting": {
143-
"enabled": true
144-
}
145-
},
146-
"tint": [1.0, 1.0, 1.0, 1.0],
147-
"texture": "grass",
148-
"sampler": "default"
149-
},
150-
"monkey": {
88+
"projectile-enemy": {
15189
"type": "lit",
15290
"shader": "lit",
91+
"transparent": true,
15392
"pipelineState": {
15493
"faceCulling": {
15594
"enabled": false
15695
},
15796
"depthTesting": {
15897
"enabled": true
159-
}
160-
},
161-
"tint": [1, 1, 1, 1],
162-
"textureAlbedo": "monkey",
163-
"sampler": "default"
164-
},
165-
"moon": {
166-
"type": "textured",
167-
"shader": "textured",
168-
"pipelineState": {
169-
"faceCulling": {
170-
"enabled": false
17198
},
172-
"depthTesting": {
173-
"enabled": true
174-
}
99+
"blending": {
100+
"enabled": true,
101+
"sourceFactor": "GL_SRC_ALPHA",
102+
"destinationFactor": "GL_ONE"
103+
},
104+
"depthMask": false
175105
},
176-
"tint": [1.0, 1.0, 1.0, 1.0],
177-
"texture": "moon",
178-
"sampler": "default"
106+
"sampler": "default",
107+
"tint": [1.0, 0.62, 0.38, 0.9],
108+
"albedo": [1.0, 0.48, 0.25],
109+
"metallic": 0.0,
110+
"roughness": 0.16,
111+
"ambientOcclusion": 1.0,
112+
"emission": [5.5, 1.7, 0.5]
179113
}
180114
},
181115
"models": {
182-
"drone": "assets/gltf/mech_drone/mech_drone.glb",
116+
"drone": "assets/gltf/drone/arcade_corki.glb",
117+
"monster": "assets/gltf/monster/drmundo.glb",
183118
"map": "assets/gltf/map/map.glb",
184119
"gun": "assets/gltf/weapons/rifle.glb"
185120
}
@@ -197,6 +132,13 @@
197132
"highlight": [1.0, 1.0, 1.0, 0.12]
198133
}
199134
},
135+
"crosshair": {
136+
"armLengthFrac": 0.012,
137+
"armThicknessFrac": 0.0025,
138+
"gapFrac": 0.006,
139+
"shadowColor": [0.02, 0.03, 0.05, 0.92],
140+
"fillColor": [0.95, 0.98, 1.0, 0.94]
141+
},
200142
"enemySpawner": {
201143
"spawnPoints": [
202144
[30.0, 0.0, 30.0],
@@ -214,20 +156,19 @@
214156
"enemies": [
215157
{
216158
"name": "Monster",
217-
"mesh": "cube",
218-
"material": "monster",
159+
"model": "monster",
219160
"rotation": [0.0, 0.0, 0.0],
220-
"scale": [0.65, 0.65, 0.65],
161+
"scale": [0.008, 0.008, 0.008],
221162
"components": [
222163
{
223164
"type": "Enemy",
224165
"enemyType": "Brute",
225166
"moveSpeed": 3.8,
226167
"turnSpeed": 5.5,
227168
"aggroRange": 120.0,
228-
"attackRange": 2.0,
169+
"attackRange": 2.5,
229170
"attackDamage": 10.0,
230-
"attackCooldown": 1.2,
171+
"attackCooldown": 0.3,
231172
"scoreValue": 100
232173
},
233174
{
@@ -237,18 +178,16 @@
237178
{
238179
"type": "Collider",
239180
"layer": "enemy",
240-
"shape": "Capsule",
241-
"radius": 0.5,
242-
"height": 1.5
181+
"shape": "Model",
182+
"model": "monster"
243183
}
244184
]
245185
},
246186
{
247187
"name": "Drone",
248-
"mesh": "cube",
249-
"material": "drone",
188+
"model": "drone",
250189
"rotation": [0.0, 0.0, 0.0],
251-
"scale": [1.2, 1.2, 1.2],
190+
"scale": [0.008, 0.008, 0.008],
252191
"components": [
253192
{
254193
"type": "Enemy",
@@ -272,7 +211,18 @@
272211
{
273212
"type": "Collider",
274213
"layer": "enemy",
275-
"radius": 0.8
214+
"shape": "Model",
215+
"model": "drone"
216+
},
217+
{
218+
"type": "Weapon",
219+
"cooldown": 1.8,
220+
"bulletSpeed": 22.0,
221+
"bulletDamage": 8.0,
222+
"bulletLifetime": 4.0,
223+
"bulletScale": 0.2,
224+
"muzzleOffset": [0.0, 0.0, -0.8],
225+
"fireSound": "gunshot-enemy"
276226
}
277227
]
278228
}
@@ -293,7 +243,8 @@
293243
{
294244
"type": "Free Camera Controller",
295245
"rotationSensitivity": 0.01,
296-
"fovSensitivity": 0.3
246+
"aimFovY": 30,
247+
"aimSpeed": 8.0
297248
},
298249
{
299250
"type": "PlayerMovement",
@@ -307,14 +258,15 @@
307258
"dashDistance": 5.0,
308259
"dashCooldown": 1.0,
309260
"groundLevel": 0.0,
310-
"playerHeight": 2,
261+
"playerHeight": 1.8,
311262
"jumpForce": 9.0
312263
},
313264
{
314265
"type": "Player"
315266
},
316267
{
317-
"type": "Post Process Effects Component"
268+
"type": "Health",
269+
"maxHealth": 100.0
318270
},
319271
{
320272
"type": "Collider",
@@ -324,8 +276,17 @@
324276
"shape": "Capsule"
325277
},
326278
{
327-
"type": "Health",
328-
"maxHealth": 100.0
279+
"type": "Weapon",
280+
"cooldown": 0.18,
281+
"bulletSpeed": 100.0,
282+
"bulletDamage": 20.0,
283+
"bulletLifetime": 2.5,
284+
"bulletScale": 0.12,
285+
"muzzleOffset": [0.45, -0.45, -2.0],
286+
"fireSound": "gunshot-player"
287+
},
288+
{
289+
"type": "Post Process Effects Component"
329290
}
330291
],
331292
"children": [
@@ -337,14 +298,6 @@
337298
{
338299
"type": "Model Renderer",
339300
"model": "gun"
340-
},
341-
{
342-
"type": "Weapon",
343-
"damage": 25.0,
344-
"range": 100.0,
345-
"fireRate": 0.15,
346-
"maxAmmo": 30,
347-
"reloadTime": 1.5
348301
}
349302
],
350303
"children": [

src/game/systems/collision-system.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ namespace gameplay {
5656
inline short getMaskForLayer(short group) {
5757
switch (group) {
5858
case LAYER_PLAYER:
59-
return LAYER_ENEMY | LAYER_ENVIRONMENT | LAYER_TRIGGER;
59+
return LAYER_ENEMY | LAYER_ENVIRONMENT | LAYER_TRIGGER | LAYER_PROJECTILE;
6060
case LAYER_ENEMY:
6161
return LAYER_PLAYER | LAYER_PROJECTILE | LAYER_ENVIRONMENT;
6262
case LAYER_ENVIRONMENT:
6363
return LAYER_PLAYER | LAYER_ENEMY | LAYER_PROJECTILE;
6464
case LAYER_PROJECTILE:
65-
return LAYER_ENEMY | LAYER_ENVIRONMENT;
65+
return LAYER_PLAYER | LAYER_ENEMY | LAYER_ENVIRONMENT;
6666
case LAYER_TRIGGER:
6767
return LAYER_PLAYER;
6868
default:

0 commit comments

Comments
 (0)