GithubHelp home page GithubHelp logo

201flaviosilva / impacto Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 6.74 MB

A modular javascript canvas render

Home Page: https://201flaviosilva.github.io/Impacto/

License: MIT License

JavaScript 99.76% HTML 0.24%
canvas game-engine impacto javascript rendering-engine

impacto's Introduction

Hi There ๐Ÿ‘‹

const me = {
  pt: "Sou um programador de front-end e desenvolvedor de jogos ๐Ÿ‘พ, e tento ser util em geral ๐Ÿฅฒ",
  en: "I'm a front-end developer and games developer ๐Ÿ‘พ, and I try to be helpful in general ๐Ÿฅฒ",
};

export default me;

๐Ÿšง Projects

๐Ÿšง Projects

Web

Games

๐Ÿ’ช Skills

๐Ÿ’ช Skills

export const programming = {
	languages: ["HTML", "CSS/SASS", "JavaScript/TS", "Python/GDScript"],
	frameworksAndLibraries: ["React", "Svelte", "Phaser", "Jest/RTL/Vitest"],
	tools: ["Git", "GitHub/GitLab/Bitbucket", "VS Code", "Godot"],
};

export const design = ["Open Toonz", "Piskel/Pixil Art"];
๐Ÿ“Š Stats

๐Ÿ“Š Stats

Check My Social Networks

Visitor Count

Github Stats

Github Top Langs

Github Streak

Github Trophy

Wakatime Stats

Snake Animation

impacto's People

Contributors

201flaviosilva avatar dependabot[bot] avatar

Stargazers

 avatar  avatar

Watchers

 avatar

impacto's Issues

[Bug]:

Engine Version
0.9.0

Describe the bug
If you CD into docs and run npm start the beautiful Docusaurus site displays on localhost 3000. However, if you run npm run build and npm run serve, a plain looking JSDoc site gets served instead. Somehow the Docusaurus site does not get served outside of your local environment.

To Reproduce
Steps to reproduce the behavior:

  1. CD into docs
  2. Run npm run build
  3. Run npm run serve
  4. You will see a plain JSDoc site

Expected behavior
I expect the exact same, beautiful Docusaurus site to get served outside of my local environment.

Screenshots
npm start displays the correct Docusaurus site:
Screen Shot 2022-12-08 at 9 54 40 AM
Screen Shot 2022-12-08 at 9 54 50 AM

npm run build and npm run serve only displays a JSDoc site:
Screen Shot 2022-12-08 at 9 53 03 AM

Desktop (please complete the following information):

  • OS: MacBook Pro M1 chip
  • Browser: Chrome

Additional context
I saw your comments on Docusaurus threads and I've followed many discussions. However, I think both you and I know how unclear some documentation can be for people who are just getting started.

[Engine]: Center Rectangle (Pivot Point / Anchor / Origin)

Fix the rectangle position to the center and create 2 new proprieties to the game object:

  • realX: Represents the real X position in the canvas of the rectangle;
  • realY: Represents the real Y position in the canvas of the rectangle;

[Engine]: Document Code (JSDocs)

JSDocs

  • Impacto.js
  • Game.js
  • Core
    • CoreGameManager.js
  • GameObjects
    • GameObject2D.js
    • Types.js
    • GameObjects.js
    • AudioPlay
      • AudioPlay.js
    • Circle
      • Circle.js
    • Line
      • Line.js
    • Polygon
      • Polygon.js
    • Rectangle
      • Rectangle.js
    • Sprite
      • Animation.js
      • Animations.js
      • Sprite.js
    • Text
      • Options.js
      • Text.js
    • Triangle.js
      • Triangle.js
  • Inputs
    • Inputs.js
    • Keyboard.js
    • Keys.js
    • Mouse.js
  • Scenes
    • Scene.js
  • State
    • AssetsManager.js
    • CanvasState.js
    • GlobalStateManager.js
    • State.js
  • Utils
    • Math.js
    • Utils.js

[Engine]: Draw objects and Physics objects

Draw Objects:

Simple objects with no physics.
Example:

  • Text;
  • Triangle;
  • Circle;
  • Square;
  • Etc...;

These objects can:

  • Change position;
  • Scale;
  • Rotate;

Physic Objects:

Objects with are affected by collisions, gravity, etc...
For now, just 2 objects supported:

  • Circle;
  • Square;

These objects can:

  • Everything the other objects do, but will only render, the physics (for now) will not scale and rotate, (only position).

Refs:

Polygon Static Game Object

Some help code used originally for triangle:

import GameObject from "../GameObjectBase.js";
import { CanvasInstance } from "../../Utils/Canvas.js";
import Types from "../Types.js";

export default class Triangle extends GameObject {
	constructor(x, y, vertex1, vertex2, vertex3, fillColor = "#ffffff", strokeColor = "#000000") {
		super(x, y, fillColor, strokeColor);
		this.vertex1 = vertex1;
		this.vertex2 = vertex2;
		this.vertex3 = vertex3;

		this._type = Types.triangle
	}

	get x() { return this._x; }
	get y() { return this._y; }

	// Private
	_renderType() {
		CanvasInstance.context.save();
		CanvasInstance.context.translate(this.x, this.y);

		CanvasInstance.context.beginPath();
		CanvasInstance.context.moveTo(this.vertex1.x, this.vertex1.y);
		CanvasInstance.context.lineTo(this.vertex2.x, this.vertex2.y);
		CanvasInstance.context.lineTo(this.vertex3.x, this.vertex3.y);
		CanvasInstance.context.closePath();
		CanvasInstance.context.stroke();
		CanvasInstance.context.fill();

		CanvasInstance.context.restore();
	}
}

Framework for tests?

Hey there :)

Does anyone have any idea what might be the most suitable tool for testing this project?
I have a little experience in "jasmine", but nothing too relevant.

(If anyone ever sees this and responds, I would be very happy ๐Ÿ˜… )

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.