Giter Site home page Giter Site logo

kingdomsandcastles's Introduction

GitHub - User Stats

Semi-professional programmer. Fluent in Python and a bit of C++ and C#. Currently I'm taking Algebra II, in 7th Grade (I'm in a private school).

I first started coding in 4th Grade, learning Python from the book Python for Kids by Jason R. Briggs. I advanced quickly, creating a 300-line calculator and moved to creating GUIs with tkinter and finding game libraries like Pygame. After using Pygame for a few months, I found out that it didn't have much functionality and good documentation. It was also slow. So, on my reserach, I discovered Pyglet and Arcade.

I am usually pretty busy with school, but here are some projects that I contribute and work with::

  1. pyglet

    pyglet is a powerful, yet easy to use Python library for developing games and other visually-rich applications on Windows, Mac OS X and Linux. It supports windowing, user interface event handling, Joysticks, OpenGL graphics, loading images and videos, and playing sounds and music. All of this with a friendly Pythonic API, that's simple to learn and doesn't get in your way.

    pyglet is provided under the BSD open-source license, allowing you to use it for both commercial and other open-source projects with very little restriction.

  2. arcade

    Arcade is an easy-to-learn Python library for creating 2D video games. It is ideal for people learning to program, or developers that want to code a 2D game without learning a complex framework.

I am interested in GUI and game development. Feel free to ask me for help on a project; e.g. GUI for a game, graphics, etc. I usually don't charge anything.

Contact me here:

Discord (most active spot) EthanC145#8543
Email [email protected]
StackExchange/StackOverflow Ethan Chan

kingdomsandcastles's People

Contributors

eschan145 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

kingdomsandcastles's Issues

Ballistae and cannons

In the future, artillery weapons like ballistae and cannons could be added. Cannons would be used for destroying walls, and ballistae for destroying large numbers of troops in formations. The cannons would need a fire effect, and the cannonball would leave a temporary trail of fire as it wooshed through the air and when it hit its target, explode, cutting through the ground seven feet and scything through seventeen men.

A ballista 3D model has already been created. When the cannonball how the ground, it would have to create fire, which could spread around until extinguished by water. It would only be able to spread in flammable things, like soldiers or dry grass.

Problems with `Slider`

The Slider has multiple problems:

  • Changing the value of the Slider
  • Functionality with mouse
  • Functionality with keyboard

These are not going to be fixed currently.

Add more GUI widgets

More GUI widgets need to be added.

  • Toggle — switch between boolean values
  • Shapes
  • Combobox — dropdown containing list of values (IN PROGRESS)
  • File — window with display to choose file
  • Scrollbar — scrollbar to scroll down frames, etc. (IN PROGRESS)
  • Pushable — customized button
  • Messagebox — messagebox for constructs

These also need to be added to the docs.

Entry IncrementalTextLayout causing error when empty

After all of the text is deleted in an entry, arcade crashes. This is because its IncrementalTextLayout has no glyphs and an AssertionError is raised. Also, the caret does not show on the line start before the entry receives text input

Execution

  1. Place the following code in a new file in the same location as the widgets.py and color.py files
  2. After it starts, click on the Entry and attempt to delete all of the text
from arcade import Window
from widgets import Container, Entry
from color import WHITE


class MyWindow(Window):

    def __init__(self, title, width, height):
        Window.__init__(
            self, width, height, title, style=Window.WINDOW_STYLE_DIALOG
        )

        self.container = Container()

        self.entry = Entry(
            250,
            160)

        self.background_color = WHITE

    def click(self):
        print(self.entry.get())

    def on_draw(self):
        self.clear()
        
        self.container.draw()


window = MyWindow(" ", 500, 400)
run()

Arrows stick in soldiers when they are shot

Instead of a soldier doing nothing if an arrow hits him, it would be more realistic if the arrow stayed stuck in him, or if in close range tore right through. In the arrow's update function, we could add a feature to simulate drag when the arrow hits flesh. You would have to calculate its direction and slow it down incrementally. The faster the arrow is, the more flesh it tears through.

This could also replace the current projectile damage algorithm, checking how many pixels of flesh it passed. Volleys would definitely look really cool with that. Instead of having hundreds of unnecessary complex Arrow sprites, they would be an instance of an arcade texture.

Only one side firing arrows

Only one side can fire arrows right now. That probably has to have something to do with the soldiers' update functions.

Update documentation of GUI

The documentation of the GUI widgets had many flaws and obsolete parameters. Use the GUI in the widgets.py to update the documentation.

Now the documentation can be found in the widgets.py file.

Commands

In many wargames similar to this one like Shieldwall, there is a command palette at the bottom of the screen. A palette of common commands can be put on the top right corner of the screen, and directly below the palette a button to access a full inventory of commands.

Common commands:

  • Volley
  • Follow me
  • Form ranks
  • Charge
  • Formation (opens a list of player-created formations from a file)

Using Pymunk's physics engine

Using a pymunk physics engine has multiple problems.

  • Moving army. Needs to set pymunk.Body.force
  • Knockback for soldiers
  • Collision checks (use pymunk.Space.add_collision_handler()
  • Arrows accelerating after fired
  • Melee combat

A new strategy is needed. I've added ShapeFilters to specify collision so that arrows don't cause soldiers to move, using32-bitwise integers.

Currently, when two armies clash, the attacking army always overpowers the other. The other army needs to apply force so they'd actually fight back, instead of just being pushed back.

Links for additional help:

Handful of soldiers taking on an army dozens of times larger

In one battle scenario, I had a unit of twenty men and another of four thousand. The twenty men sprayed as many arrows as if there were four thousand of them until all of their arrows were spent. This must be changed in the units, where the number of soldiers in a unit is divided by the rate of fire. This might seem the tiniest bit realistic as if the soldiers are desperate, but after they use up their arrows they are quickly destroyed by the larger unit. Note that the larger army was more than 200 times larger.

Soldiers melee attack

One thing about real battlefields is that soldiers swarm into armies and fight them with swords and spears. It is partially implemented in Armies but the fighting sucks. Many things need to be changed.

  • Soldiers must not bump into other soldiers
  • Soldiers should move as groups
  • Soldiers have different speeds
  • Soldiers use spears at close-range and swords at extreme close range
    The pymunk physics engine could help with pushing and knockback from arrows.

Improvements to `Entry`

Multiple improvements can be added to the Entry.

  • Capitalize all instances of "Entry" in README.md
  • Adding select-all with Control—A
  • Adding clipboard enhancements with Control—C and Control—V
  • Adding rich text formatting to Entry
  • Adding option to make Entry multiline
  • Caret not showing up in line start
  • Caret invisible or visible instead of changing color when blinking
  • Caret glitching on blinks at line end
  • Undo and redo features
  • Enable updates for smoother updates. This raises an AssertionError, one that has been seen before.
  • Show feature for passwords

Adding subunits

As stated in README.md, units were to culminate and branch into bigger units. We could make something like a UnitGroup or UnitList, which would have a list of units. Another class could be Flank, which would contain the three flanks of an army. After a flank would be a legion, which could be split into regiments and then battalions and then companies and platoons and squadrons.

Unit Size Commander
Army General
Flank Lieutenant General
Legion 10,000 men Commandant
Regiment 3,000—4,000 men Colonel
Battalion 1,000 men Lieutenant Colonel
Company 200 men Captain
Platoon 40 men Lieutenant
Squadron 10 men Noncommisioned officer

image

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.