Giter Club home page Giter Club logo

reflexy's Introduction

Reflexy

version

A pixel-art pygame project

๐Ÿšจย ๐Ÿ•ท ย  Concept

A samurai battling a bunch of robotic spiders that shoot deadly lasers, anyway, just another day in the life of a samurai...

Spider Arena

๐Ÿค–ย ๐Ÿฆพ ย  Genetic Algorithm and Artificial Neural Network

This project is also a sandbox to work with handmade IA algorithms. The intent is to create a model to guide the actions of the spiders, making them act in the group in a smart way.

The next GIF show the vision of the player and the spiders. Both the characters have a multiple of 36 lines of sight around, 10ยฐ apart. Every 36 lines are destined to identify a certain object, returning 1 if seen, or 0 if not.

Spider Arena AI

The characters of spiders have 4 groups of 36 lines of sights, each one identify below, in order of priority:

  • Red lines: Enemy (player) detected.
  • Blue lines: Laser detected.
  • Green lines: Ally (spiders) detected.
  • Black lines: Wall detected.

In case none of the items above is identified, the line is present in silver.

  • Silver lines: Nothing detected.

The character of the player doesn't have the group of lines of sight destined to allies.

Also, the two classes of characters have an extra "line" of sight in format of a square, as a mean to prevent lasers coming from a blindspot.

๐Ÿ“ฆย ๐Ÿ•น ย  Dependencies

  • pygame

๐Ÿ› ย ๐Ÿงฐ ย  Run and Test

Enviroment

$ # Create and activate a virtual environment
$ pip install requirements.txt # Install the dependencies

Running

$ python reflexy/main.py

Testing

$ pip install -r requirements-dev.txt # Install the dependencies
$ pytest reflexy

reflexy's People

Contributors

henriqueaurelio01 avatar romavini avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

reflexy's Issues

Refactor the Ray

It seems that the blit function is not the best to draw the ray on screen.

Draw images to the sprites.

Draw in a pixel art style:

  • Player
    • Animate walk to 8 direction (4 frames to each side)
  • Laser Spider
    • Animate walk to 8 direction (4 frames to each side)
  • Laser
    • Animate fire (10 frames)

Refactor Code.

Improve the structure and organization of the code. Sugestion:

Reflexy/reflexy/
+-- main.py โ€ƒ โ€ƒ -> call runner function
+-- runner.py โ€ƒ โ€ƒ -> set time and loop
+-- menus/
|โ€ƒ โ€ƒ +-- menus.py โ€ƒ โ€ƒ -> start, in-game and restart menus
+-- models/
|โ€ƒ โ€ƒ +-- player.py โ€ƒ โ€ƒ -> player sprite
|โ€ƒ โ€ƒ +-- spider.py โ€ƒ โ€ƒ -> spider sprite
+-- weapons/
|โ€ƒ โ€ƒ +-- ray.py โ€ƒ โ€ƒ -> ray sprite
|โ€ƒ โ€ƒ +-- sword.py โ€ƒ โ€ƒ -> sword sprite
+-- logic/
|โ€ƒ โ€ƒ +-- simple/
|โ€ƒ โ€ƒ |โ€ƒ โ€ƒ +-- spider_logic.py โ€ƒ โ€ƒ -> default spider brain
|โ€ƒ โ€ƒ +-- ann/
|โ€ƒ โ€ƒ |โ€ƒ โ€ƒ +-- player_logic.py โ€ƒ โ€ƒ -> ann interpreter
|โ€ƒ โ€ƒ |โ€ƒ โ€ƒ +-- spider_logic.py โ€ƒ โ€ƒ -> ann interpreter
+-- helpers/
|โ€ƒ โ€ƒ +-- general.py
|โ€ƒ โ€ƒ +-- moviments.py โ€ƒ โ€ƒ -> spider and player moviments
|โ€ƒ โ€ƒ +-- colision.py โ€ƒ โ€ƒ -> colision system and checks
|โ€ƒ โ€ƒ +-- math.py โ€ƒ โ€ƒ

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.