Skip to content

Commit 23e17b3

Browse files
committed
init commit
0 parents  commit 23e17b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+8927
-0
lines changed

.clangformat

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ColumnLimit: 0
2+
IndentWidth: 4

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
public/

.eslintrc

+140
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es6": true,
5+
"node": true,
6+
"serviceworker": true
7+
},
8+
"settings": {
9+
"react": {
10+
"version": "detect"
11+
}
12+
},
13+
"globals": {
14+
"workbox": true
15+
},
16+
"parser": "babel-eslint",
17+
"extends": [
18+
"plugin:react/recommended",
19+
"eslint:recommended",
20+
"plugin:react-hooks/recommended",
21+
"plugin:eslint-plugin-import/recommended"
22+
],
23+
"parserOptions": {
24+
"ecmaVersion": 9,
25+
"sourceType": "module"
26+
},
27+
"rules": {
28+
"padding-line-between-statements": [
29+
"error",
30+
{
31+
"blankLine": "always",
32+
"prev": "*",
33+
"next": "return"
34+
},
35+
{
36+
"blankLine": "always",
37+
"prev": [
38+
"const",
39+
"let",
40+
"var",
41+
"import"
42+
],
43+
"next": "*"
44+
},
45+
{
46+
"blankLine": "always",
47+
"prev": "*",
48+
"next": [
49+
"for",
50+
"switch",
51+
"if",
52+
"try"
53+
]
54+
},
55+
{
56+
"blankLine": "always",
57+
"prev": "*",
58+
"next": "export"
59+
},
60+
{
61+
"blankLine": "always",
62+
"prev": "*",
63+
"next": "function"
64+
},
65+
{
66+
"blankLine": "any",
67+
"prev": [
68+
"const",
69+
"let",
70+
"var"
71+
],
72+
"next": [
73+
"const",
74+
"let",
75+
"var"
76+
]
77+
},
78+
{
79+
"blankLine": "any",
80+
"prev": [
81+
"import"
82+
],
83+
"next": [
84+
"import"
85+
]
86+
},
87+
{
88+
"blankLine": "any",
89+
"prev": [
90+
"export"
91+
],
92+
"next": [
93+
"export"
94+
]
95+
}
96+
],
97+
"no-unused-vars": "off",
98+
"unused-imports/no-unused-imports": "error",
99+
"unused-imports/no-unused-vars": [
100+
"warn",
101+
{
102+
"vars": "all",
103+
"varsIgnorePattern": "^_",
104+
"args": "after-used",
105+
"argsIgnorePattern": "^_"
106+
}
107+
],
108+
"indent": [
109+
"error",
110+
4,
111+
{
112+
"SwitchCase": 1
113+
}
114+
],
115+
"eol-last": [
116+
"error",
117+
"never"
118+
],
119+
"quotes": [
120+
"error",
121+
"double"
122+
],
123+
"semi": [
124+
"error",
125+
"never"
126+
],
127+
"react-hooks/rules-of-hooks": "error",
128+
"react/prop-types": "off",
129+
"react/jsx-uses-react": "off",
130+
"react/react-in-jsx-scope": "off",
131+
"react/display-name": "off"
132+
},
133+
"plugins": [
134+
"unused-imports",
135+
"babel",
136+
"react",
137+
"react-hooks",
138+
"eslint-plugin-import"
139+
]
140+
}

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
public/
3+
*.blend1

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# zax
2+
3+
- add sfx for space asteroides, player death, and figthers
4+
- fighers material
5+
- color enemy bullets differently from player bullets
6+
- add more decorational elements + replace the ugly ones
7+
- improve asteroide seperator wall handling
8+
- more random ground deco astroide
9+
- ui
10+
- better sfx for forcefield
11+
- support game pad (ps4)
12+
- gameplay loop
13+
- improve performance
14+
15+
- add asteroid tower elements for dodging
16+
- add air mines?
17+
- revise color palette

assets/grass.blend

6.01 MB
Binary file not shown.

assets/icons/pwa-icon.png

6.51 KB
Loading

assets/models/grass.glb

7.38 MB
Binary file not shown.

assets/models/grass2.glb

1.37 MB
Binary file not shown.

assets/shaders/fog_frag.glsl

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#ifdef USE_FOG
2+
vec3 fogPos = vec3(0., .25, 0.);
3+
float fogHeight = 7.5;
4+
float fogDensity = easeInOutQuad(clamp(1. - (vFogWorldPosition.y - fogPos.y) / fogHeight, .0, 1.));
5+
vec3 fogColor = vec3(0./255., 89./255., 255./255.); // 4EA8DE, 78, 168, 222
6+
7+
gl_FragColor.rgb = mix(gl_FragColor.rgb, fogColor, fogDensity);
8+
#endif

assets/shaders/fog_pars_frag.glsl

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#ifdef USE_FOG
2+
uniform vec3 fogColor;
3+
uniform vec3 fogNearColor;
4+
5+
#ifdef FOG_EXP2
6+
uniform float fogDensity;
7+
#else
8+
uniform float fogNear;
9+
uniform float fogFar;
10+
#endif
11+
12+
varying vec3 vFogWorldPosition;
13+
uniform float time;
14+
#endif
15+
16+
float easeInOutQuad(float x) {
17+
return x < 0.5 ? 2. * x * x : 1. - pow(-2. * x + 2., 2.) / 2.;
18+
}

assets/shaders/fog_pars_vertex.glsl

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#ifdef USE_FOG
2+
varying vec3 vFogWorldPosition;
3+
#endif

assets/shaders/fog_vertex.glsl

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#ifdef USE_FOG
2+
vFogWorldPosition = (modelMatrix * vec4( transformed, 1.0 )).xyz;
3+
#endif

assets/splashscreens/ipad_splash.png

14.9 KB
Loading
16.8 KB
Loading
23.3 KB
Loading
17.9 KB
Loading
5.7 KB
Loading
7.1 KB
Loading
13.8 KB
Loading
13.9 KB
Loading
9.5 KB
Loading
16.4 KB
Loading

assets/styles/app.scss

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@import "global.scss";
2+
@import "variables.scss";
3+
@import "typography.scss";

assets/styles/global.scss

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
* {
2+
margin: 0;
3+
padding: 0;
4+
border: none;
5+
font-family: inherit;
6+
font-size: inherit;
7+
line-height: inherit;
8+
color: inherit;
9+
outline: none;
10+
text-decoration: none;
11+
list-style: none;
12+
background-color: transparent;
13+
-webkit-tap-highlight-color: rgba(255, 255, 255, 0) !important;
14+
//appearance: none;
15+
}
16+
17+
html {
18+
background-color: #000;
19+
}
20+
21+
html,
22+
body {
23+
height: 100vh;
24+
overflow: hidden;
25+
}
26+
27+
.visually-hidden {
28+
position: absolute;
29+
overflow: hidden;
30+
clip: rect(0 0 0 0);
31+
height: 1px;
32+
width: 1px;
33+
margin: -1px;
34+
padding: 0;
35+
border: 0;
36+
}
37+
38+
::selection {
39+
background-color: #000;
40+
opacity: 1;
41+
color: #FFF;
42+
}
43+
44+
45+
html,
46+
body {
47+
overflow: hidden;
48+
background-color: #0059FF;
49+
}
50+
51+
#root {
52+
height: 100vh !important;
53+
width: 100% !important;
54+
}
55+
56+
canvas#main {
57+
top: 0;
58+
position: fixed;
59+
display: block;
60+
height: 100vh !important;
61+
width: 100% !important;
62+
right: 0;
63+
left: 0;
64+
image-rendering: -moz-crisp-edges;
65+
image-rendering: -webkit-crisp-edges;
66+
image-rendering: pixelated;
67+
image-rendering: crisp-edges;
68+
}

assets/styles/typography.scss

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
html {
2+
font-family: 'Press Start 2P', monospace;
3+
font-weight: 400;
4+
font-size: 1em;
5+
color: #FFF;
6+
}

assets/styles/variables.scss

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
:root {
2+
// vars here
3+
}

assets/views/index.html

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title>Grass</title>
5+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover" />
7+
<link rel="preconnect" href="https://fonts.gstatic.com">
8+
<link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap" rel="stylesheet">
9+
10+
<link href="/splashscreens/iphone5_splash.<%= htmlWebpackPlugin.options.rev %>.png" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image" />
11+
<link href="/splashscreens/iphone6_splash.<%= htmlWebpackPlugin.options.rev %>.png" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image" />
12+
<link href="/splashscreens/iphoneplus_splash.<%= htmlWebpackPlugin.options.rev %>.png" media="(device-width: 621px) and (device-height: 1104px) and (-webkit-device-pixel-ratio: 3)" rel="apple-touch-startup-image" />
13+
<link href="/splashscreens/iphonex_splash.<%= htmlWebpackPlugin.options.rev %>.png" media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3)" rel="apple-touch-startup-image" />
14+
<link href="/splashscreens/iphonexr_splash.<%= htmlWebpackPlugin.options.rev %>.png" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image" />
15+
<link href="/splashscreens/iphonexsmax_splash.<%= htmlWebpackPlugin.options.rev %>.png" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3)" rel="apple-touch-startup-image" />
16+
<link href="/splashscreens/ipad_splash.<%= htmlWebpackPlugin.options.rev %>.png" media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image" />
17+
<link href="/splashscreens/ipadpro1_splash.<%= htmlWebpackPlugin.options.rev %>.png" media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image" />
18+
<link href="/splashscreens/ipadpro3_splash.<%= htmlWebpackPlugin.options.rev %>.png" media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image" />
19+
<link href="/splashscreens/ipadpro2_splash.<%= htmlWebpackPlugin.options.rev %>.png" media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image" />
20+
</head>
21+
22+
<body>
23+
<div id="root"></div>
24+
<div id="debug" style="position: fixed; bottom: 20px; z-index: 9999999; left:20px; color: #FFF"></div>
25+
<noscript>
26+
<h1>You need to enable Javascript to use this site.</h1>
27+
</noscript>
28+
</body>
29+
</html>

babel.config.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const { browserslist } = require("./package.json")
2+
3+
module.exports = {
4+
presets: [
5+
"@babel/preset-react",
6+
[
7+
"@babel/preset-env",
8+
{
9+
targets: browserslist,
10+
debug: false,
11+
useBuiltIns: "usage",
12+
corejs: { version: 3, proposals: true }
13+
}
14+
]
15+
],
16+
plugins: [
17+
"@babel/plugin-proposal-class-properties",
18+
[
19+
"@babel/plugin-transform-react-jsx",
20+
{
21+
"runtime": "automatic"
22+
}
23+
]
24+
]
25+
}

now.json

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"env": {
3+
"REGISTER_SERVICEWORKER": "@register-serviceworker"
4+
},
5+
"build": {
6+
"env": {
7+
"REGISTER_SERVICEWORKER": "@register-serviceworker"
8+
}
9+
},
10+
"routes": [
11+
{
12+
"src": "/app.bundle.*",
13+
"headers": {
14+
"cache-control": "max-age=9000000"
15+
}
16+
},
17+
{
18+
"src": "css/*.css",
19+
"headers": {
20+
"cache-control": "max-age=9000000"
21+
}
22+
},
23+
{
24+
"src": "splashscreens/*.png",
25+
"headers": {
26+
"cache-control": "max-age=9000000"
27+
}
28+
}
29+
]
30+
}

0 commit comments

Comments
 (0)