fruta 0.0.3 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +367 -26
  3. package/dist/animation/anim.d.ts +13 -0
  4. package/dist/animation/animate.d.ts +101 -0
  5. package/dist/audio/audio.d.ts +29 -0
  6. package/dist/fruta.d.ts +302 -0
  7. package/dist/fruta.js +19 -0
  8. package/dist/frutaGl.d.ts +277 -0
  9. package/dist/game/behaviors.d.ts +38 -0
  10. package/dist/game/charts.d.ts +127 -0
  11. package/dist/game/play.d.ts +4 -0
  12. package/dist/game/project.d.ts +54 -0
  13. package/dist/input/gamepad.d.ts +38 -0
  14. package/dist/math/math.d.ts +37 -0
  15. package/dist/math/pathfind.d.ts +7 -0
  16. package/dist/math/physics.d.ts +38 -0
  17. package/dist/math/pool.d.ts +11 -0
  18. package/dist/math/spatial.d.ts +10 -0
  19. package/dist/render/create/FontCreator.d.ts +16 -0
  20. package/dist/render/create/SaveRestore.d.ts +5 -0
  21. package/dist/render/create/ShapeCreator.d.ts +49 -0
  22. package/dist/render/create/canvasTarget.d.ts +5 -0
  23. package/dist/render/shaders.d.ts +29 -0
  24. package/dist/render/webgl.d.ts +67 -0
  25. package/dist/renderer.d.ts +42 -0
  26. package/dist/types.d.ts +9 -0
  27. package/dist/utils/logStyle.d.ts +1 -0
  28. package/dist/world/camera.d.ts +24 -0
  29. package/dist/world/entities.d.ts +45 -0
  30. package/dist/world/particles.d.ts +42 -0
  31. package/dist/world/tilemap.d.ts +44 -0
  32. package/dist/world/timers.d.ts +11 -0
  33. package/package.json +35 -35
  34. package/DOCUMENTATION.MD +0 -874
  35. package/dist/main.js +0 -1
  36. package/index.html +0 -9
  37. package/settings.json +0 -6
  38. package/src/core/create/_fontCreator.js +0 -11
  39. package/src/core/create/_saveOrRestore.js +0 -22
  40. package/src/core/create/_shapeCreator.js +0 -20
  41. package/src/core/create/fontCreatorMixin.js +0 -167
  42. package/src/core/create/shapeCreatorMixin.js +0 -656
  43. package/src/core/fruta.js +0 -22
  44. package/src/core/game/game.js +0 -30
  45. package/src/core/game/scene.js +0 -29
  46. package/src/core/game/tick.js +0 -42
  47. package/src/core/utils/logStyle.js +0 -8
  48. package/src/core/utils/utils.js +0 -0
  49. package/src/methods/constants.js +0 -0
  50. package/src/methods/creator/_scene.js +0 -0
  51. package/src/methods/creator/creator.js +0 -0
  52. package/webpack.config.js +0 -47
@@ -1,29 +0,0 @@
1
- /**
2
- * @description
3
- This is the scene file, where the canvases are created
4
- and properties are assigned to them.
5
- */
6
- import { consoleStyle } from '../utils/logStyle'
7
-
8
- export default class Scene {
9
- constructor(config) {
10
- this.config = config
11
- }
12
-
13
- createScene = () => {
14
- /**
15
- * @TODO
16
- * Refactoring the code
17
- * Implement more configurations for the canvas
18
- */
19
- const canvas = document.createElement('canvas')
20
- canvas.setAttribute('id', this.config.id)
21
-
22
- canvas.width = this.config.w
23
- canvas.height = this.config.h
24
-
25
- document.body.appendChild(canvas)
26
-
27
- consoleStyle("LET'S DO IT BABY!")
28
- }
29
- }
@@ -1,42 +0,0 @@
1
- /**
2
- * @description
3
- The Tick class will be responsible for keeping track of the game time.
4
- It will also have a specific method for rendering, which can be used to
5
- render elements in real-time.
6
-
7
- To accomplish this, we will use callbacks so that the user can choose which
8
- things will be updated and which ones will not be updated.
9
-
10
- (This is still subject to discussion.)
11
- */
12
-
13
- export default class Tick {
14
- constructor() {
15
- this.tick = 0
16
- this.lastFrameTick = Date.now()
17
- this.updateCallback = null
18
- this.run()
19
- }
20
-
21
- run = () => {
22
- const newTime = Date.now()
23
- this.tick = this.tick += (newTime - this.lastFrameTick) / 1000
24
- this.lastFrameTick = newTime
25
-
26
- this.onRenderFunctionality()
27
-
28
- requestAnimationFrame(this.run)
29
- }
30
-
31
- /* Setters/Getters */
32
- OnRender = (callback) => {
33
- this.updateCallback = callback
34
- }
35
-
36
- /* functionalities here */
37
- onRenderFunctionality = () => {
38
- if (typeof this.updateCallback === 'function') {
39
- this.updateCallback(this.tick)
40
- }
41
- }
42
- }
@@ -1,8 +0,0 @@
1
- const consoleStyle = (message) => {
2
- const style =
3
- 'font-weight: bold; font-size: 50px;color: red; text-shadow: 3px 3px 0 rgb(217,31,38) , 6px 6px 0 rgb(226,91,14) , 9px 9px 0 rgb(245,221,8) , 12px 12px 0 rgb(5,148,68) , 15px 15px 0 rgb(2,135,206) , 18px 18px 0 rgb(4,77,145) , 21px 21px 0 rgb(42,21,113)'
4
-
5
- return console.log(`%c${message}`, style)
6
- }
7
-
8
- export { consoleStyle }
File without changes
File without changes
File without changes
File without changes
package/webpack.config.js DELETED
@@ -1,47 +0,0 @@
1
- const path = require('path')
2
- const HtmlWebpackPlugin = require('html-webpack-plugin')
3
-
4
- const isProduction = process.env.NODE_ENV == 'production'
5
-
6
- const config = {
7
- entry: './src/core/fruta.js',
8
- output: {
9
- path: path.resolve(__dirname, 'dist'),
10
- },
11
- devServer: {
12
- open: true,
13
- host: 'localhost',
14
- },
15
- plugins: [
16
- new HtmlWebpackPlugin({
17
- template: 'index.html',
18
- }),
19
-
20
- // Add your plugins here
21
- // Learn more about plugins from https://webpack.js.org/configuration/plugins/
22
- ],
23
- module: {
24
- rules: [
25
- {
26
- test: /\.(js|jsx)$/i,
27
- loader: 'babel-loader',
28
- },
29
- {
30
- test: /\.(eot|svg|ttf|woff|woff2|png|jpg|gif)$/i,
31
- type: 'asset',
32
- },
33
-
34
- // Add your rules for custom modules here
35
- // Learn more about loaders from https://webpack.js.org/loaders/
36
- ],
37
- },
38
- }
39
-
40
- module.exports = () => {
41
- if (isProduction) {
42
- config.mode = 'production'
43
- } else {
44
- config.mode = 'development'
45
- }
46
- return config
47
- }