GithubHelp home page GithubHelp logo

senior-sigan / why_cpp Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 2.0 1.47 MB

Simple Game Engine in C++ to create Retro games.

Home Page: https://senior-sigan.github.io/WHY_CPP/

License: MIT License

CMake 0.76% Makefile 0.03% C++ 3.39% C 95.52% HTML 0.15% JavaScript 0.14% Objective-C 0.01%
sdl2 game-engine cpp whycpp gamedev gamedev-framework fantasy-console emscripten

why_cpp's Introduction

Build Status

About

WHYCPP is a simple, fantacy-console inspired, library to create pixel-art games. The main idea behind WHYCPP is to have fun by coding entire game, without all these fancy features a typical framework offers.

Featues

You can:

  • create games in C++, C, JavaScript;
  • draw EACH pixel on the screen manually;
  • draw primitive shapes;
  • load and draw png textures;
  • play wav sounds;
  • handle keyboard and mouse;
  • compile game into Web Page using emscripten.

Requirements

Windows

On Windows you can only develop using MSYS2 and MinGW.

When you have MSYS2 installed, run these commands to install necessary tools:

pacman -S mingw-w64-x86_64-make mingw-w64-x86_64-cmake mingw-w64-x86_64-gcc mingw-w64-x86_64-pkg-config mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_mixer

Linux

For Debian-based Linux run these commands:

sudo apt install cmake make g++ libsdl2-dev libsdl2-mixer-dev

Mac OS

I suppose you have Homebrew installed.

Run these commands:

brew install sdl2 sdl2_mixer

You may need to activate developer tools: xcode-select --install

How to create game?

For C++

  1. Fork template project WHY_CPP_template
  2. Write your code in src dir.
  3. Just run make in the terminal to compile and run. Template is preconfigured to automatically download the latest release of WHYCPP.

Or

  1. Fork this repository.
  2. Create a new dir, for example game, with content like we have for example
  3. Add line to the CMakeLists.txt: add_subdirectory(game).
  4. If you need, you can add to the Makefile new tasks like example-compile and example-run

why_cpp's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

bootak dohujiko

why_cpp's Issues

Texture import

Importing texture from a PNG file without color-pallete constrains.

Fonts rendering

Add functions to draw some text in the screen.

API:

  • text position (x,y)
  • text size
  • text color
  • bacground color
  • ? import another fonts (add another resource file)

Text input.

I want to do leaderboard. Now to text input I must use 30 or more ifs. Could you add possibility to normal text input.

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.