The 2D Game Engine written on JavaScript.

Overview

CherryEngine

The 2D Game Engine written in JavaScript.

NEW UPDATE

Version 1.2
Added: TypeObjectError.js Changed: static methods are not static now, you should call method from class object

Documentation

First of all, you should import ../engine/Engine.js file.
In Engine.js you should fill APPLICATION_INFORMATION array required information.(not working yet)

Constructor

constuctor accepts only 1 parameter, thats the debug mode, value can be false or true

Functions

Create_$Object(SceneID, GameObjectID, type, textContent, x = 0, y = 0, sourceURL, color = "#000000") - Creates an object
SceneID - id of scene
GameObjectID - id of object
type - object type. Now engine has only three object types Text, Sprite and Image.
textContent - this var stores text that will be diplayed in text object type.
x - x position. (default 0)
y - y position. (default 0)
sourceURL - picture URL.
color - HEX color of object.

Set_$Border(GameObjectID, borderSize, borderColor, borderType, borderRadius) - Sets border

GameObjectID - id of object
borderSize - border size
borderColor - color of border
borderType - border type
borderRadius - border radius

Set_$BackGround(GameObjectID, bg) - Sets background
GameObjectID - id of object
bg - background color

Set_$Color(GameObjectID, color) - Sets text color
GameObjectID - id of object
color - color in hex

MoveX(GameObjectID, x = 0) - Move to X position
GameObjectID - id of object
x - x position. (default 0)

MoveY(GameObjectID, y = 0) - Move to Y position
GameObjectID - id of object
y - y position. (default 0)

Create_$Rect(SceneID, GameObjectID, x = 0, y = 0, height = '100px', width = '100px', borderSize = 1, borderColor = "#000000", borderType = 'solid', background = '#000000') - draw a rect

SceneID - id of scene
GameObjectID - id of object
x - x position. (default 0)
y - y position. (default 0)
height - height of rect. (default 100px)
width - width of rect. (default 100px)
borderSize - the size of border in px
borderColor - the color of border
borderType - the type of border(css)
background - the color of background

Create_$Circle(SceneID, GameObjectID, x = 0, y = 0, height = '100px', width = '100px', borderSize = 1, borderColor = "#000000", borderType = 'solid', background = '#000000') - draw a circle
SceneID - id of scene
GameObjectID - id of object
x - x position. (default 0)
y - y position. (default 0)
height - height of circle. (default 100px)
width - width of circle. (default 100px)
borderSize - the size of border in px
borderColor - the color of border
borderType - the type of border(css)
background - the color of background


Move(GameObjectID, x = 0, y = 0) - Moves *GameObject to x, and y position
GameObjectID - id of object
x - x position. (default 0)
y - y position. (default 0)

getByStaticId(staticID) - Gets *GameObject by static id(data-fixedid attr.)
staticID - The static id of *GameObject

Delete_$Object(GameObjectID) - Delete the *GameObject
GameObjectID - id of object

Object_$Rotate(GameObjectID, deg) - Rotates object
GameObjectID - id of object
deg - Degrees of rotation

Object_$RotateY(GameObjectID, deg) - Rotates object to Y
GameObjectID - id of object
deg - Degrees of rotation

Object_$RotateX(GameObjectID, deg) - Rotates object to X
GameObjectID - id of object
deg - Degrees of rotation

Object_$RotateZ(GameObjectID, deg) - Rotates object to Z
GameObjectID - id of object
deg - Degrees of rotation

Object_$Scale(GameObjectID, size) - Scales the *GameObject
GameObjectID - id of object
size - the size of scale(default: 1)

Object_$SetTransTime(GameObjectID, ms) - Sets the transition time to *GameObject
GameObjectID - id of object
ms - the time in ms

Object_$Layer(GameObjectID, ObjectLayer) - Change layer position for *GameObject
GameObjectID - id of object
ObjectLayer - the layer for *GameObject(default: 0)

Events.js

OnObjectClick(GameObjectID, callback) - Sets the listener for clicking the *GameObject
GameObjectID - The id of *GameObject
callback - function of event

OnMouseObjectHover(GameObjectID, callback) - Sets the listener for mouse hover on *GameObject
GameObjectID - The id of *GameObject
callback - function of event

OnMouseObjectExit(GameObjectID, callback) - Sets the listener for mouse leave from *GameObject
GameObjectID - The id of *GameObject
callback - function of event

Scene.js

Scene_$Create(SceneID, width, height, x, y) - Creates an new Scene for game
SceneID - the id of scene(string)
width - the width of scene
height - the height of scene
x - x position of scene
y - y position of scene

Scene_$Delete(SceneID) - Deletes the scene
SceneID - the id of scene(string)

Scene_$Layer(SceneID, SceneLayer) - Sets the layer of scene
SceneID - the id of scene(string)
SceneLayer - The layer of scene(default: 0)

Requests.js

$Post(url, data = {}) - Making post request
url - the url for request
data - the data of request(default: {})

$Get(url) - Making get request
url - the url for request

Co-Authored by: Kolyah35

You might also like...

HTML5 Game Engine

HTML5 Game Engine

Quintus Engine Quintus is an easy-to-learn, fun-to-use HTML5 game engine for mobile, desktop and beyond! The Quintus engine is an HTML5 game engine de

Dec 21, 2022

a discord-based monster catching game engine, used for Lozpekamon on our Discord server

discord-monster-catching-game a discord-based monster catching game engine, used for Lozpekamon on our Discord server How to Use Requirements install

Oct 30, 2022

This is a Tic Tac Toe game built with HTML, CSS, and JavaScript. It is a simple and fun game where two players take turns marking X and O on a 3x3 grid.

This is a Tic Tac Toe game built with HTML, CSS, and JavaScript. It is a simple and fun game where two players take turns marking X and O on a 3x3 grid.

Tic Tac Toe Game This is a Tic Tac Toe game built with HTML, CSS, and JavaScript. It is a simple and fun game where two players take turns marking X a

Mar 4, 2023

Recreated Chromium T-Rex game in Phaser 3, written in HTML5 & TypeScript

Recreated Chromium T-Rex game in Phaser 3, written in HTML5 & TypeScript

Chromium Dino Game - Phaser 3 + TypeScript + Parcel Chromium Dino Game Clone using Phaser 3 + TypeScript + Parcel Play You can play online here Dino P

Jun 21, 2022

A lightweight "Falling Sand Game" written in TypeScript

TechSquid Falling Sand Game | TSFSG A lightweight "Falling Sand Game" written in TypeScript with Pixi.js. Click to spawn particles of sand. TO DO: col

Aug 15, 2022

NFT Game Starter Project: https://github.com/buildspace/buildspace-nft-game-starter

Running React on Repl.it React is a popular JavaScript library for building user interfaces. Vite is a blazing fast frontend build tool that includes

Feb 11, 2022

Conways-game-of-life - A Conway's Game Of Life project using Python

conways-game-of-life A Conway's Game Of Life project using Python JavaScript Devlog January 1st 2022: also need to remember Python's syntax a bit will

Sep 23, 2022

Slime jumper game is a simple game that requires you to escape from the enemies that come your way.

Slime Jumper What is this game? The slime jumper game is a game with a simple logic (but it was not so easy to do) where you have to escape from the e

Mar 1, 2022
Releases(cherry)
Owner
> sazix
JS Coder
> sazix
The project integrates workflow engine, report engine and organization authority management background, which can be applied to the development of OA, HR, CRM, PM and other systems. With tlv8 IDE, business system development, testing and deployment can be realized quickly.

介绍 项目集成了工作流引擎、报表引擎和组织机构权限管理后台,可以应用于OA、HR、CRM、PM等系统开发。配合使用tlv8 ide可以快速实现业务系统开发、测试、部署。 后台采用Spring MVC架构简单方便,前端使用流行的layui界面美观大方。 采用组件开发技术,提高系统的灵活性和可扩展性;采

Qian Chen 38 Dec 27, 2022
An ASCII (technically PETSCII :)) "Game Engine" for JavaScript

Announcement! I'm putting this project on hold, because I remembered how much I hate JavaScript. (Please don't take offense, it's just my preference.)

eboatwright 16 Nov 12, 2022
Interactive visualiser 🌠 for a 3D raymarching engine written in GLSL and computed in a fragment shader on the 2D Plane.

Getting Started Node version used : 16.13.1 First install dependencies with: npm install # or yarn install Then, run the development server: npm run d

Michal Zalobny 22 Nov 12, 2022
🌌 Fast, in-memory, full-text search engine written in TypeScript. Now in beta.

Installation You can install Lyra using npm, yarn, pnpm: npm i @nearform/lyra yarn add @nearform/lyra pnpm add @nearform/lyra Usage Lyra is quite simp

NearForm 5.1k Dec 30, 2022
Word guessing game, written in JavaScript and beautifully designed in CSS

Word Guessing Game Word guessing game, written in JavaScript and beautifully designed in CSS This is a word guessing game that I built. You can play i

Rachit Pal 4 Sep 17, 2022
Free, open source game engine online

microStudio is a free, open source game engine online. It is also a platform to learn and practise programming. microStudio can be used for free at ht

Gilles 719 Dec 30, 2022
Trying to make a game engine apparently.

Clockwork - a game engine from scratch The goal of this project is to build a game engine, I still don't know what it needs to do, but will update thi

Anas Mazouni 2 Oct 31, 2021
Melon.js game engine bindings for Solid

Melon Solid This project fuses the awesome frameworks Melon.js (for game development) and Solid.js (for making websites). By combining them together y

null 10 Oct 4, 2022
Attempt #2 at creating a game engine with Sciter.

JogoMaker Attempt #2 at creating a game engine with Sciter, with love and care. For Attempt #1, see this project, which was hastily thrown together as

null 3 Sep 5, 2022
2D HTML5 rendering and layout engine for game development

Stage.js is a 2D HTML5 JavaScript library for cross-platform game development, it is lightweight, fast and open-source. Check out examples and demos!

Ali Shakiba 2.2k Jan 3, 2023