GithubHelp home page GithubHelp logo

nikthewik / encounters Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 24.85 MB

enCounters is a space-themed mini game that combines the dynamics of a counter to these of the game of the goose.

Home Page: https://ntw-encounters.netlify.app/

License: MIT License

CSS 14.93% JavaScript 76.63% HTML 8.44%
counter css flexbox js mobile-first-workflow mini-game

encounters's Introduction

enCounters

This is a project built for the JavaScript Basics exam on start2impact University. enCounters is a space-themed mini game that combines the dynamics of a counter to these of the game of the goose.

enCounters preview

Table of Contents

Overview

The assignment

Creating a fully responsive counter, equipped with two +/- buttons to increase or decrease the counter value.

Another requirement is to use only JavaScript (no HTML tags in the body, no Jquery or framework) for element creation and counter display management.

All additional features deemed necessary are allowed.

Technologies used

  • Semantic HTML
  • CSS
  • JS
  • JS Modules
  • Flexbox
  • Responsive design
  • Mobile-first workflow

Link

My process

Idea

I decided to create a space-themed mini game based on a counter and the game of the goose, driven by my passion for video games, the necessity to sharpen my skills in JavaScript, and the desire to make this project useful for others (and for me as well, as a portfolio).

The game is very simple. Every time the + button or the - button is pressed, there is a certain chance that an event will occur:

  • The counter increases or decreases by 1, depending on the button pressed;
  • A positive quest occurs, advancing the player by X light years;
  • A negative quest occurs, causing the player to regress by X light years.

When the counter reaches 100, the player wins. If the counter reaches -100, he loses.

Development

The first step was to write a JS function capable of generating elements based on specific arguments, automating the process and saving me from repetitive tasks.

As I created site elements, I took care of their style with CSS, using a mobile-first approach.

Finally, with JavaScript, I focussed on how the game's logic should work and on the various additional features.

After realising that I wrote 650+ lines of code, I thought it was appropriate to split the main.js file into three separate modules: main.js, elements.js, and quests.js. In this way the code is more orderly and maintainable.

Soundtrack

I took an additional step by using GarageBand to compose the game's soundtrack. I aimed to capture a spatial ambiance that evoked the thrill of interstellar exploration. You can listening to it by clicking here.

GarageBand screenshot

Author

License

Distributed under the MIT License. See LICENSE.txt for more information.

Acknowledgments

  • Jonas Schmedtmann - Hands down, the best JS instructor on Udemy from which I learned a lot;
  • ChatGPT - An artificial intelligence chatbot (developed by OpenAI), which I mainly used to review some JavaScript code and to create some quests;
  • Stack Overflow - A wonderful community where you can find a solution to every Front-End Development problem and not only.

encounters's People

Contributors

nikthewik avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

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.