├── .github └── pull_request_template.md ├── .gitignore ├── CODEOWNERS ├── LICENSE ├── Panda3D ├── README.md ├── img │ ├── 1.png │ ├── 2.png │ ├── 3.png │ ├── 4.png │ └── 5.png └── panda.py ├── README.md ├── logo.png ├── mini_nodejs_akinator ├── .gitignore ├── README.md ├── app.js ├── package.json ├── static │ └── style.css └── views │ ├── add_question.jade │ └── index.jade └── pyproject.toml /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | #### Motivation: #### 2 | 3 | PR motivation goes here. 4 | 5 | #### What's done: #### 6 | * item one 7 | 8 | Link to tests: [_link placeholder_] 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | 27 | # PyInstaller 28 | # Usually these files are written by a python script from a template 29 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 30 | *.manifest 31 | *.spec 32 | 33 | # Installer logs 34 | pip-log.txt 35 | pip-delete-this-directory.txt 36 | 37 | # Unit test / coverage reports 38 | htmlcov/ 39 | .tox/ 40 | .coverage 41 | .coverage.* 42 | .cache 43 | nosetests.xml 44 | coverage.xml 45 | *,cover 46 | .hypothesis/ 47 | 48 | # Translations 49 | *.mo 50 | *.pot 51 | 52 | # Django stuff: 53 | *.log 54 | local_settings.py 55 | 56 | # Flask stuff: 57 | instance/ 58 | .webassets-cache 59 | 60 | # Scrapy stuff: 61 | .scrapy 62 | 63 | # Sphinx documentation 64 | docs/_build/ 65 | 66 | # PyBuilder 67 | target/ 68 | 69 | # IPython Notebook 70 | .ipynb_checkpoints 71 | 72 | # pyenv 73 | .python-version 74 | 75 | # celery beat schedule file 76 | celerybeat-schedule 77 | 78 | # dotenv 79 | .env 80 | 81 | # virtualenv 82 | venv/ 83 | ENV/ 84 | 85 | # Spyder project settings 86 | .spyderproject 87 | 88 | # Rope project settings 89 | .ropeproject 90 | 91 | # Covers JetBrains PyCharm IDE project files (user-specific stuff): 92 | .idea/ 93 | 94 | # PyPI release autogenerated files 95 | MANIFEST 96 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | 2 | # See https://help.github.com/articles/about-codeowners/ 3 | # for more info about CODEOWNERS file 4 | 5 | # It uses the same pattern rule for gitignore file 6 | # https://git-scm.com/docs/gitignore#_pattern_format 7 | 8 | * @duboviy 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Eugene Duboviy 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Panda3D/README.md: -------------------------------------------------------------------------------- 1 | # Panda3D simple mini game prototype 2 | Just trying out game development project prototypes 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Panda3D/img/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duboviy/gamedev/e36a220564be940282eadb036d85090a5364d9d4/Panda3D/img/1.png -------------------------------------------------------------------------------- /Panda3D/img/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duboviy/gamedev/e36a220564be940282eadb036d85090a5364d9d4/Panda3D/img/2.png -------------------------------------------------------------------------------- /Panda3D/img/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duboviy/gamedev/e36a220564be940282eadb036d85090a5364d9d4/Panda3D/img/3.png -------------------------------------------------------------------------------- /Panda3D/img/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duboviy/gamedev/e36a220564be940282eadb036d85090a5364d9d4/Panda3D/img/4.png -------------------------------------------------------------------------------- /Panda3D/img/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duboviy/gamedev/e36a220564be940282eadb036d85090a5364d9d4/Panda3D/img/5.png -------------------------------------------------------------------------------- /Panda3D/panda.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from math import pi, sin, cos 3 | 4 | from direct.showbase.ShowBase import ShowBase 5 | from direct.task import Task 6 | from direct.actor.Actor import Actor 7 | from direct.interval.IntervalGlobal import Sequence 8 | from panda3d.core import Point3 9 | 10 | 11 | class PandaGameApp(ShowBase): 12 | 13 | def __init__(self): 14 | ShowBase.__init__(self) 15 | 16 | # Disable the camera trackball controls. 17 | self.disableMouse() 18 | # Add the spinCameraTask procedure to the task manager. 19 | self.taskMgr.add(self.spinCameraTask, "SpinCameraTask") 20 | 21 | self.configure_environ() 22 | self.confige_actor() 23 | 24 | def configure_environ(self): 25 | # Load the environment model. 26 | self.environ = self.loader.loadModel("models/environment") 27 | # Reparent the model to render. 28 | self.environ.reparentTo(self.render) 29 | # Apply scale and position transforms on the model. 30 | self.environ.setScale(0.25, 0.25, 0.25) 31 | self.environ.setPos(-8, 42, 0) 32 | 33 | def confige_actor(self): 34 | # Load and transform the panda actor. 35 | self.pandaActor = Actor("models/panda-model", 36 | {"walk": "models/panda-walk4"}) 37 | self.pandaActor.setScale(0.005, 0.005, 0.005) 38 | self.pandaActor.reparentTo(self.render) 39 | # Loop its animation. 40 | self.pandaActor.loop("walk") 41 | 42 | # Create the four lerp intervals needed for the panda to 43 | # walk back and forth. 44 | PosInterval1 = self.pandaActor.posInterval(3, Point3(0, -10, 0), 45 | startPos=Point3(0, 10, 0)) 46 | PosInterval2 = self.pandaActor.posInterval(3, Point3(0, 10, 0), 47 | startPos=Point3(0, -10, 0)) 48 | HprInterval1 = self.pandaActor.hprInterval(1, Point3(180, 0, 0), 49 | startHpr=Point3(0, 0, 0)) 50 | HprInterval2 = self.pandaActor.hprInterval(1, Point3(0, 0, 0), 51 | startHpr=Point3(180, 0, 0)) 52 | 53 | # Create and play the sequence that coordinates the intervals. 54 | self.pandaPace = Sequence(PosInterval1, 55 | HprInterval1, 56 | PosInterval2, 57 | HprInterval2, 58 | name="pandaPace") 59 | self.pandaPace.loop() 60 | 61 | # Define a procedure to move the camera. 62 | def spinCameraTask(self, task): 63 | angleDegrees = task.time * 6.0 64 | angleRadians = angleDegrees * (pi / 180.0) 65 | self.camera.setPos(20 * sin(angleRadians), -20.0 * cos(angleRadians), 3) 66 | self.camera.setHpr(angleDegrees, 0, 0) 67 | return Task.cont 68 | 69 | 70 | if __name__ == "__main__": 71 | app = PandaGameApp() 72 | app.run() 73 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

logo gamedev

2 | 3 | by [Eugene Duboviy](https://duboviy.github.io/) 4 | 5 | [![Code Health](https://landscape.io/github/duboviy/gamedev/master/landscape.svg?style=flat)](https://landscape.io/github/duboviy/gamedev/master) [![Open Source Love](https://badges.frapsoft.com/os/mit/mit.svg?v=102)](https://github.com/duboviy/gamedev/) [![PRs & Issues Welcome](https://img.shields.io/badge/PRs%20&%20Issues-welcome-brightgreen.svg)](https://github.com/duboviy/gamedev/pulls) [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/duboviy/gamedev/) 6 | 7 | A sandbox for trying out game development project prototypes 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | ## License 19 | 20 | **MIT** licensed library. See [LICENSE.txt](LICENSE.txt) for details. 21 | 22 | ## Contributing 23 | 24 | If you have suggestions for improving the gamedev, please [open an issue or 25 | pull request on GitHub](https://github.com/duboviy/gamedev/). 26 | 27 | ## Badges 28 | 29 | [![forthebadge](http://forthebadge.com/images/badges/fuck-it-ship-it.svg)](https://github.com/duboviy/gamedev/) 30 | [![forthebadge](http://forthebadge.com/images/badges/built-with-love.svg)](https://github.com/duboviy/gamedev/) [![forthebadge](http://forthebadge.com/images/badges/built-by-hipsters.svg)](https://github.com/duboviy/gamedev/) [![forthebadge](http://forthebadge.com/images/badges/built-with-swag.svg)](https://github.com/duboviy/gamedev/) 31 | 32 | [![forthebadge](http://forthebadge.com/images/badges/powered-by-electricity.svg)](https://github.com/duboviy/gamedev/) [![forthebadge](http://forthebadge.com/images/badges/powered-by-oxygen.svg)](https://github.com/duboviy/gamedev/) [![forthebadge](http://forthebadge.com/images/badges/powered-by-water.svg)](https://github.com/duboviy/gamedev/) [![forthebadge](http://forthebadge.com/images/badges/powered-by-responsibility.svg)](https://github.com/duboviy/gamedev/) 33 | 34 | [![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=102)](https://github.com/ellerbrock/open-source-badge/) 35 | 36 | [![forthebadge](http://forthebadge.com/images/badges/makes-people-smile.svg)](https://github.com/duboviy/gamedev/) 37 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duboviy/gamedev/e36a220564be940282eadb036d85090a5364d9d4/logo.png -------------------------------------------------------------------------------- /mini_nodejs_akinator/.gitignore: -------------------------------------------------------------------------------- 1 | # npm installed packages 2 | node_modules/ 3 | -------------------------------------------------------------------------------- /mini_nodejs_akinator/README.md: -------------------------------------------------------------------------------- 1 |

logo NodeJS Akinator

2 | 3 | by [Eugene Duboviy](https://duboviy.github.io/) 4 | 5 | [![Code Health](https://landscape.io/github/duboviy/gamedev/master/landscape.svg?style=flat)](https://landscape.io/github/duboviy/gamedev/master) [![Open Source Love](https://badges.frapsoft.com/os/mit/mit.svg?v=102)](https://github.com/duboviy/gamedev/) [![PRs & Issues Welcome](https://img.shields.io/badge/PRs%20&%20Issues-welcome-brightgreen.svg)](https://github.com/duboviy/gamedev/pulls) [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/duboviy/gamedev/) 6 | 7 | Mini NodeJS Akinator App that tries to guess the animal 8 | 9 | ## Installation: 10 | 11 | Install NodeJS with npm and install dependencies using: 12 | ``` 13 | $ npm install 14 | ``` 15 | 16 | ## Usage: 17 | 18 | Just execute: 19 | ``` 20 | $ node app.js 21 | ``` 22 | And open [link](http://127.0.0.1:3000/) in your browser: 23 | http://127.0.0.1:3000/ 24 | 25 | ## License 26 | 27 | **MIT** licensed library. See [LICENSE.txt](LICENSE.txt) for details. 28 | 29 | ## Contributing 30 | 31 | If you have suggestions for improving the gamedev, please [open an issue or 32 | pull request on GitHub](https://github.com/duboviy/gamedev/). 33 | 34 | ## Badges 35 | 36 | [![forthebadge](http://forthebadge.com/images/badges/fuck-it-ship-it.svg)](https://github.com/duboviy/gamedev/) 37 | [![forthebadge](http://forthebadge.com/images/badges/built-with-love.svg)](https://github.com/duboviy/gamedev/) [![forthebadge](http://forthebadge.com/images/badges/built-by-hipsters.svg)](https://github.com/duboviy/gamedev/) [![forthebadge](http://forthebadge.com/images/badges/built-with-swag.svg)](https://github.com/duboviy/gamedev/) 38 | 39 | [![forthebadge](http://forthebadge.com/images/badges/powered-by-electricity.svg)](https://github.com/duboviy/gamedev/) [![forthebadge](http://forthebadge.com/images/badges/powered-by-oxygen.svg)](https://github.com/duboviy/gamedev/) [![forthebadge](http://forthebadge.com/images/badges/powered-by-water.svg)](https://github.com/duboviy/gamedev/) [![forthebadge](http://forthebadge.com/images/badges/powered-by-responsibility.svg)](https://github.com/duboviy/gamedev/) 40 | 41 | [![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=102)](https://github.com/ellerbrock/open-source-badge/) 42 | 43 | [![forthebadge](http://forthebadge.com/images/badges/makes-people-smile.svg)](https://github.com/duboviy/gamedev/) -------------------------------------------------------------------------------- /mini_nodejs_akinator/app.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | 3 | var app = express(); 4 | 5 | var model = { 6 | '1': { text: 'Does it have two legs?' }, 7 | '2': { text: 'Does it have feathers?' }, 8 | '3': { text: 'Does it have hoof?' }, 9 | '4': { text: 'Is it quacking?' }, 10 | '5': { text: 'Is it a man?' }, 11 | '6': { text: 'Is it a cloven-hoofed?' }, 12 | '7': { text: 'Is it pulling in claws?' }, 13 | '8': 'A Duck', 14 | '9': 'A Chicken', 15 | '10': 'A Human', 16 | '11': 'A Monkey', 17 | '12': 'A Cow', 18 | '13': { text: 'Does it have horn?' }, 19 | '14': 'A Cat', 20 | '15': 'A Dog', 21 | '26': 'A Rhinoceros', 22 | '27': 'A Horse' 23 | }; 24 | 25 | app.set('view engine', 'jade'); 26 | app.use(express.static('static')); 27 | 28 | var bodyParser = require('body-parser'); 29 | app.use(bodyParser.json()); // support json encoded bodies 30 | app.use(bodyParser.urlencoded({ extended: true })); // support encoded bodies 31 | 32 | 33 | app.get('/', function(req, res) { 34 | res.redirect('/q/1') 35 | }) 36 | 37 | app.get('/q/:question_id', function(req, res) { 38 | var id = +req.params.question_id; 39 | var question = model[id]; 40 | 41 | if(typeof question == 'object') { // ask question 42 | res.render('index', { 43 | question: question.text, 44 | go_yes: '/q/' + (id * 2), 45 | go_no: '/q/' + (id * 2 + 1), 46 | }) 47 | } else { // try to guess 48 | res.render('index', { 49 | question: 'Is it ' + question + '?', 50 | go_yes: '/hurray', 51 | go_no: '/wrong_guess/' + id, 52 | }) 53 | } 54 | }); 55 | 56 | app.get('/hurray', function(req, res) { 57 | res.send('Congratulations! You are winner!!! New game!') 58 | }) 59 | 60 | app.get('/wrong_guess/:question_id', function(req, res) { 61 | var id = +req.params.question_id; 62 | res.render('add_question', { 63 | animal: model[id], 64 | }) 65 | }) 66 | 67 | app.post('/wrong_guess/:question_id', function(req, res) { 68 | var id = +req.params.question_id; 69 | var old_animal = model[id]; 70 | var new_animal = req.body.new_animal; 71 | 72 | if(req.body.right_answer == 'yes') { 73 | model[id * 2] = old_animal; 74 | model[id * 2 + 1] = new_animal; 75 | } else { 76 | model[id * 2] = new_animal; 77 | model[id * 2 + 1] = old_animal; 78 | }; 79 | 80 | model[id] = { 81 | text: req.body.new_question, 82 | } 83 | console.log(model); 84 | res.send('Thank you for the hint! New game!') 85 | }) 86 | 87 | 88 | app.listen(3000, function() { 89 | console.log('Listening on port 3000'); 90 | }) 91 | -------------------------------------------------------------------------------- /mini_nodejs_akinator/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "animals", 3 | "version": "0.0.1", 4 | "description": "Mini NodeJS Akinator App that tries to guess the animal", 5 | "main": "app.js", 6 | "scripts": { 7 | "start": "node app.js" 8 | }, 9 | "author": "Eugene Duboviy", 10 | "license": "ISC", 11 | "dependencies": { 12 | "express": "^4.13.4", 13 | "jade": "^1.11.0", 14 | "body-parser": "^1.15.0" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /mini_nodejs_akinator/static/style.css: -------------------------------------------------------------------------------- 1 | a { 2 | margin: 5px; 3 | padding: 3px; 4 | border-radius: 3px; 5 | border: 1px solid gray; 6 | } 7 | 8 | span { 9 | margin: 5px; 10 | } 11 | -------------------------------------------------------------------------------- /mini_nodejs_akinator/views/add_question.jade: -------------------------------------------------------------------------------- 1 | html 2 | head 3 | title New animal 4 | style(src="style.css") 5 | body 6 | h1 New animal 7 | form(method="post", action="") 8 | p Which animal you have wished? 9 | input(name="new_animal", type="text") 10 | p What question distinguishes animal #{animal} from that what you wished? 11 | input(name="new_question", type="text") 12 | p What is the answer to this question for animal #{animal}? 13 | span Yes 14 | input(type="radio", name="right_answer", value="yes", checked=true) 15 | span No 16 | input(type="radio", name="right_answer", value="no") 17 | input(type="submit", value="Save") 18 | -------------------------------------------------------------------------------- /mini_nodejs_akinator/views/index.jade: -------------------------------------------------------------------------------- 1 | html 2 | head 3 | title Animals 4 | link(rel="stylesheet", href="/style.css") 5 | body 6 | h1 Animals 7 | p Think about an animal, program will try to guess it... 8 | 9 | p= question 10 | p 11 | a(href=go_yes) Yes 12 | span   13 | a(href=go_no) No 14 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.black] 2 | line-length = 79 3 | skip-string-normalization = true 4 | skip-numeric-underscore-normalization = true 5 | include = '\.pyi?$' 6 | exclude = ''' 7 | /( 8 | \.eggs 9 | | \.git 10 | | \.venv 11 | | venv 12 | | \.idea 13 | | \.vscode 14 | )/ 15 | ''' 16 | --------------------------------------------------------------------------------