GithubHelp home page GithubHelp logo

aspjt / roguelike Goto Github PK

View Code? Open in Web Editor NEW
92.0 3.0 8.0 732 KB

๐Ÿฆ‡: Roguelike

License: Boost Software License 1.0

C++ 100.00%
dtl game-2d roguelike roguelikedev roguelike-game roguelike-library roguelike-dungeons rogue-like roguelike-rpg-game roguelike-engine

roguelike's Introduction


Supported Compilers ๐Ÿ”ง

Compiler Run
MSVC None
GCC Wandbox
Clang Wandbox

Generated Image ๐Ÿ–ผ๏ธ

rl1 rl2


Example

#include "RogueLike.hpp"
#include <array>
#include <iostream>

int main() {

	using shape_t = int;
	std::array<std::array<shape_t, 32>, 24> matrix{ {} };

	dtl::shape::RogueLike<shape_t>(0, 1, 2, 3, 4, 20,
		dtl::base::MatrixRange(3, 3, 2, 2),
		dtl::base::MatrixRange(3, 3, 4, 4)).draw(matrix);

	for (const auto& i : matrix) {
		for (const auto& j : i)
			std::cout << j << ',';
		std::cout << '\n';
	}

	for (const auto& i : matrix) {
		for (const auto& j : i)
			switch (j) {
			case 0:std::cout << "%%"; break;
			case 1:std::cout << "##"; break;
			case 2:std::cout << "  "; break;
			case 3:std::cout << "++"; break;
			case 4:std::cout << "--"; break;
			}
		std::cout << '\n';
	}

	return 0;
}
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,1,0,0,1,4,1,1,1,0,0,0,0,0,0,
0,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,2,2,1,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,1,4,4,4,4,1,0,1,1,1,1,1,2,2,2,1,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,0,0,0,
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%############%%%%######%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%##        ##%%%%##--######%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%##        ##%%%%##------##%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%##        ##%%%%##--##--##%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%##########++####%%%%##--##--##%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%##----------##%%%%%%##--######%%%%%%%%%%%%
%%######################++##########%%%%%%##++########%%%%%%%%%%
%%##------------++        ##%%%%%%%%%%%%%%##        ##%%%%%%%%%%
########--########        ############%%%%##        ##%%%%%%%%%%
##--------##%%%%##        ####      ########        ##%%%%%%%%%%
######--####%%%%######++######      ++--########++####%%%%%%%%%%
%%%%##--##%%%%%%##----------++      ##------------##%%%%%%%%%%%%
%%%%##--##%%%%%%##############      ##--########--######%%%%%%%%
%%%%##--##%%%%%%%%############++######--##%%%%##------##%%%%%%%%
%%%%##--##%%%%%%%%##------------##%%##--############++####%%%%%%
%%%%##--##%%%%%%%%############--##%%######------++      ##%%%%%%
%%%%######%%%%%%%%%%%%##--------##%%%%%%######--##      ##%%%%%%
%%%%%%%%%%%%%%%%%%%%%%######--########%%##------##      ##%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%##--------##%%##########      ##%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%############%%%%%%%%%%##########%%%%%%

>> View License ๐Ÿ’ณ

Copyright (c) 2018-2022 As Project.

Distributed under the Boost Software License, Version 1.0.(See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


Related Items ๐ŸŽฎ

PAX_SAPIENTICA DTL GenkaiSyuraku AsLib

roguelike's People

Contributors

aspjt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.