justinmeister / mario-level-1 Goto Github PK
View Code? Open in Web Editor NEWThe first level of Super Mario Bros made with Python and Pygame.
The first level of Super Mario Bros made with Python and Pygame.
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
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.
In https://github.com/justinmeister/Mario-Level-1/blob/master/data/tools.py#L68
On your toggle_fps method with_fps is not declared
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.
Hello justinmeister!
I currently work with your Mario. How could I contact you?
In the hope you will answer,
Zzortell
PS: I'm French :)
Actually, I meet two issues. The first is that when I run the program there is an error "libpng warning: iCCP: known incorrect sRGB profile". And even I did not run the main() function, a window open. I do not know whether this is due to this error.
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
Traceback (most recent call last):
File "D:\My Documents\GitHub\Mario-Level-1\mario_level_1.py", line 9, in
import pygame as pg
ImportError: No module named pygame
i want faster game speed.
how fast game speed??
Is there any argument that control whether disable the sound?
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.
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?
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!
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
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!
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
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
hi master, i run it in eclipse + pydev environment
python 2.7 + pygame 1.9.1
found some bug
the music stop randomly when I play
I can not close the window
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
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.
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'
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))
This repository doesn't provide a LICENSE file. Hence, despite the disclaimer in the README, the source code is governed by strict copyright (i.e. it is forbidden to copy, use, modify and distribute the program in any form).
If you want to provide the entire source code as free software I would suggest you add a GNU General Public License v3 license file.
More information about software licenses: https://help.github.com/articles/licensing-a-repository/
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))
can,t jump
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.
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?
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.