Coder Social home page Coder Social logo

mario-level-1's Introduction

Super Mario Bros Level 1

An attempt to recreate the first level of Super Mario Bros.

screenshot

CONTROLS:

Arrow keys for direction

'a' for jump

's' for action (fireball, run)

DEPENDENCIES:

Pygame 1.9.1 (Python 2)

Pygame 1.9.2 (Python 3) - a little trickier to get going.

To install dependencies for Python 2.x:

pip install -r requirements.txt

VIDEO DEMO:

http://www.youtube.com/watch?v=HBbzYKMfx5Y

DISCLAIMER:

This project is intended for non-commercial educational purposes.

mario-level-1's People

Contributors

justinmeister avatar mekza avatar metulburr 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

mario-level-1's Issues

The screen freezes after taking Mushroom

OS: macOS 10.15.1 (Catalina)
Python 3.7.3
pygame 1.9.6

After Mario takes the mushroom and grows large, the screen freezes and the timer stops counting down. But the background music is still there

How to hold on the game waitting the trainning of an agent

I am trying to use this game environment to train an agent by learning algorithm.But each trainning step need much time,so that the game enviroment can't recieve an action without delay.Actually the game will stack at one frame due to the delay of the action command.How should I pause the game and train my agent,and start it again when the train step is over?I am struggling for this issue for a long time.

Does it work on Mac?

I tried running it on Mac, but couldnt find any keys that worked? So was stuck at the 1 player / 2 player choice screen; couldnt get any further.

Cannot install dependencies

When I run:
pip install -r requirements.txt

I get:
Could not find a version that satisfies the requirement pygame==1.9.1release (from -r requirements.txt (line 1)) (from versions: ) No matching distribution found for pygame==1.9.1release (from -r requirements.txt (line 1))

I am on OSX El Capitan using Conda.
I tried installing via pip and conda.
Also with python 2 and 3 environments.

Do I need to install pygame from the official site on my computer?

Contact

Hello justinmeister!
I currently work with your Mario. How could I contact you?
In the hope you will answer,
Zzortell

PS: I'm French :)

how to build .exe file in macos?

how can you build .exe file in macos, my personal python project need to build .exe to run in windows for the users like your mario project,could you give me some ideas or recommend me some useful tools?

quick step forward bug

hi, when trying to make small steps, ie
when repeadetly pressing the right arrow -> key, mario is supposed to move a pixel to the right,
instead he stays in place or moves one pixel to the left (backwards)..
when doing the same in the other direction (facing left) with the left arrow key <-, the game behaves as expected
other than that, great job, congratulations!

Can we pull the results from the game?

I know that this isn't an issue but more of a question, I need to know if someone could pull the results and use that in another script or another Python file. I am trying to make an AI for this, and would love to know if this is possible.

Thanks

failing dots for graphic file extensions

This is a really nice remaking of super mario. I think you have probably forgotten the dots before the last two file extension parameters at tools.py line 113 (load_all_gfx()).
I also wanted to ask if you could show me some sources to understand the magic of relative imports which you have used, i am having troubles doing relative imports in python. Could you tell me where have you learned about it?

Regards,
Amir

key bindings

The only issue i have with it is the key bindings drive me nuts. It seems unnatural. It seems like movements keys should be WASD, jump being space, and fire being left shift (assuming there will not be a run key), (for easy access to all keys with one hand). Either that or the ability to change the key bindings in game preferably, but if not then a key binding dictionary at least to change.

Confusing key bindings.

In README.md you say 'a' for jump and 's' for action. But in fact, I have to press shift + 'a' instead of 'a' to jump and shift + 's' instead of 's' to take action. And if I press 'A' ('a' with CapsLk) or 'S' ('s' with CapsLk), nothing happens, no jumping, no actions.
I cloned the repo and run it without changes.

missing music dir

There is no music directory in your resources

metulburr@arch ~/Downloads/Mario-Level-1-master $ python2 mario_level_1.py 
Traceback (most recent call last):
  File "mario_level_1.py", line 10, in <module>
    from data.main import main
  File "/home/metulburr/Downloads/Mario-Level-1-master/data/main.py", line 3, in <module>
    from . import setup,tools
  File "/home/metulburr/Downloads/Mario-Level-1-master/data/setup.py", line 24, in <module>
    MUSIC = tools.load_all_music(os.path.join("resources","music"))
  File "/home/metulburr/Downloads/Mario-Level-1-master/data/tools.py", line 121, in load_all_music
    for song in os.listdir(directory):
OSError: [Errno 2] No such file or directory: 'resources/music'

Highscore page possible?

Hi all,

I am making an arcade machine with a RaspberryPi and I would really like to integrate this Mario game into it. The only hold back for me is the end of the game. When you reach the end of the level, the 'game-over' state will appear. Does someone know here I can add a state with the text "The end" or maybe even a highscore page?

Regards,
Alex

please

its a great work i dont know i have to request so i do it here

you work is realy good can you make same in metal slug level one or street o rage level one?
thx a lotcontinue

Can't install

pip install -r requirements.txt results in:

  Could not find any downloads that satisfy the requirement pygame==1.9.1release (from -r requirements.txt (line 1))
  Some externally hosted files were ignored (use --allow-external pygame to allow).
Cleaning up...
No distributions at all found for pygame==1.9.1release (from -r requirements.txt (line 1))

pygame.error: File is not a Windows BMP file

i got the following error with the recent version from github:

 jojoo@soy% python mario_level_1.py
 Traceback (most recent call last):
   File "mario_level_1.py", line 10, in <module>
     from data.main import main
   File "/private/tmp/Mario-Level-1/data/main.py", line 3, in <module>
     from . import setup,tools
   File "/private/tmp/Mario-Level-1/data/setup.py", line 25, in <module>
     GFX   = tools.load_all_gfx(os.path.join("resources","graphics"))
   File "/private/tmp/Mario-Level-1/data/tools.py", line 115, in load_all_gfx
     img = pg.image.load(os.path.join(directory, pic))
 pygame.error: File is not a Windows BMP file

Error with unrecognized music format

I cloned the repo and I'm using Python 2.7.6 on Mac with pygame 1.9.2a0. When I run the game, I'm able to start a new game, but get this error right after I see the Mario has 3 lives black screen.

Traceback (most recent call last):
File "mario_level_1.py", line 15, in
main()
File "/Users/williamliu/GitHub/Mario-Level-1/data/main.py", line 18, in main
run_it.main()
File "/Users/williamliu/GitHub/Mario-Level-1/data/tools.py", line 75, in main
self.update()
File "/Users/williamliu/GitHub/Mario-Level-1/data/tools.py", line 41, in update
self.flip_state()
File "/Users/williamliu/GitHub/Mario-Level-1/data/tools.py", line 48, in flip_state
self.state.startup(self.current_time, persist)
File "/Users/williamliu/GitHub/Mario-Level-1/data/states/level1.py", line 40, in startup
self.sound_manager = game_sound.Sound(self.overhead_info_display)
File "/Users/williamliu/GitHub/Mario-Level-1/data/game_sound.py", line 15, in init
self.set_music_mixer()
File "/Users/williamliu/GitHub/Mario-Level-1/data/game_sound.py", line 22, in set_music_mixer
pg.mixer.music.load(self.music_dict['main_theme'])
pygame.error: Unrecognized music format

Game over image

When we complete level 1, a game over page pops up. It is not an issue but wanted to point out. You just have a time-up and game over page, that is probably why. Very nice coding (Nice game), waiting for level 2!

glitchy jump

If i move and then jump, the jump acts normal, with normal height and speed. However if I stand still and jump, without touching the movement keys at all, the jump is only a quarter or so as high. Sometimes this causes death as i am expecting the same height jump every time, moving or not.

Requirements failed on Ubuntu 20 py.game

Requirements failed on Ubuntu 20 py.game

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal

sudo pip install -r requirements.txt
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
ERROR: Could not find a version that satisfies the requirement pygame==1.9.6+dfsg-2build1 (from -r requirements.txt (line 1)) (from versions: 1.9.2.dev1, 1.9.2b7, 1.9.2b8, 1.9.2rc1, 1.9.2, 1.9.3, 1.9.4.dev0, 1.9.4rc1, 1.9.4, 1.9.5rc1, 1.9.5rc2, 1.9.5, 1.9.6rc1, 1.9.6rc2, 1.9.6, 2.0.0.dev1, 2.0.0.dev2, 2.0.0.dev3, 2.0.0.dev4, 2.0.0.dev6, 2.0.0.dev8, 2.0.0.dev10)
ERROR: No matching distribution found for pygame==1.9.6+dfsg-2build1 (from -r requirements.txt (line 1))

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.