プログラマーやすなり
チャンネル登録者数 1.35万人
81万 回視聴 ・ 17796いいね ・ 2024/09/28
I want to show people that programming isn't that difficult and that anyone can easily get started.
With that in mind, I'm attempting a 10-line program.
This time it's Mario.
The red square is Mario. Yeah, it looks like Mario.
I tried to recreate the scene where an enemy dies when you jump and step on it.
Pygame uses colliderect for collision detection, making it very easy.
Also, the gravitational acceleration part is simulated using pseudo-calculation,
so it only requires simple processing.
By using list comprehension, you can reduce the number of lines.
In the end, it ended up being 12 lines...
I still have a lot to learn...
■Watch the tutorial video here!
• 【解説】10行で実装したマリオのコードを展開しながら、6つの短縮テクニックを教えます...
If you'd like to see the source code, please message our official LINE account from the channel overview.
#programming #program #python
コメント
使用したサーバー: directk
コメントを取得中...