Giter Club home page Giter Club logo

cespong's Introduction

component-entity-system

cespong's People

Contributors

skylarbpayne avatar laarz avatar

Stargazers

Bill Su avatar

Watchers

James Cloos avatar

cespong's Issues

Add a Winning Scene

The Scoring System should track a max score. When the max score is reached, ScoringSystem should transition to the Win Scene. Pressing Escape should lead back to the main menu.

Add a Splash Screen

Add a splash screen that slowly fades out until starting the game. Later it should transition into the main menu.

Smooth AI motion

As of now, the AI motion is very fidgety. Need to write a better AI function to smooth the AI motion towards the ball. Essential use an algorithm like:

disY = ballY - paddleY

velY = disY * easingConstant;

if(velY > 5) velY = 5
if(velY < -5) velY = -5

This will allow the paddle to slow down as it reaches the ball height while not allowing it to surpass a certain speed.

Also, add in an accumulator to make sure AI does not update every single frame. Update AI perhaps a few times per second.

Add Main Menu

The main menu should include options for:

Play (1 Player)
Play (2 Player)
Controls

This will also mean that a button system will have to be put in place. Later this button system should be abstracted away into CES.

Add a Controls Scene

The Controls scene should display what keys should be used to control each player, as well as what keys can be used to return to the main menu.

Make paddles stay in window

The collision system, or some other sort of system needs to ensure that objects stay within the game window. This is quite a game specific system (as objects in other games may go outside the window), so I will need to think of an elegant way to allow custom behavior in terms of game objects and the window.

For now, it will suffice (and may also suffice as a permanent solution) to create another system that takes objects with colliders and ensures that that are within the window by sending a move entity message to move the entity back into the window and perhaps also a push entity message to reset speed to 0. Although, I'll have to test for the push entity message. It will probably not be necessary.

Scoring System

Add a Scoring System with scoring components. There should be two scoring entities which define each player's score. The ScoringSystem should make note of the ball and check when the ball passes out either side of the window. If it passes out left, update player 2s score, if it passes through the right, update player 1s score. This should also keep track of a max score and consequently end the game when either player reaches the max score.

Ball is able to push paddle back

Based on how the collision system works, if paddle is moving the instant that the ball collides with it, the paddle will be pushed back. An easy fix for this is to ensure that the ball is created first. However, this may not be ideal for other types of games. I will ensure that the ball is created first while thinking of other solutions for later games.

Refactor "Reset" method of ScoringSystem into GameScene

First step: Make a PointScoredMessage. Obviously, when a point is scored, emit that message.

the main game scene should inherit from a PointScoredMessage listener and on that message type, it should reset the game and then set a pause boolean.

While looping through, check the pause boolean. If the pause boolean is true, pause for a small amount of time.

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.