Giter Club home page Giter Club logo

nydd's Introduction

Nydd

Introduction

A dark mini-platform/RPG/adventure game written in Python and using the Pyxel engine.

NOTE: This project was abandoned but I'm leaving the source code up for anyone that might be interested.

Dependencies

Controls

  • Move: Arrow keys
  • Attack: Z
  • Jump: X
  • Start game/Pause: Enter
  • Quit to main menu: Q
  • Exit game: Escape

Web play test (might be an old version)

Credits

nydd's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nydd's Issues

Code review

some recommendations for your code
as I understand you could already know this things

loops

You could use iterating instead of range(len(obj)) expression.

nydd/src/utils.py

Lines 64 to 70 in d0460d1

for i in range(len(lines)):
thisChunk.append(lines[i])
count += 1
if count == lines_high:
count = 0
chunks.append(thisChunk)
thisChunk = []

Like this:

    for line in lines:
        thisChunk.append(line)
        count += 1
        if count == lines_high:
            count = 0
            chunks.append(thisChunk)
            thisChunk = []

And it looks more readable


If you need i in this situation I think it will be better to use enumerate function:

    for i, _ in enumerate(lines):
        thisChunk.append(lines[i])
        count += 1
        if count == lines_high:
            count = 0
            chunks.append(thisChunk)
            thisChunk = []

It is just an example. I think the code above is bad because you could just iterate object.


As you code in Python it is not necessary write brackets near the expression:

while (total_moved_abs < abs_dx):

    while total_moved_abs < abs_dx: 

functions

If you are in situation when every condition must have True value you can use all function or
any if at least one value have True.

nydd/src/rect.py

Lines 5 to 8 in d0460d1

return x1 < x2 + w2 and \
x1 + w1 > x2 and \
y1 < y2 + h2 and \
y1 + h1 > y2

    return all(x1 < x2 + w2, 
               x1 + w1 > x2,
               y1 < y2 + h2,
               y1 + h1 > y2)

sorry for my English

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.