[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Game with python
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 28
Thread images: 1
File: Python-logo-notext.svg.png (173 KB, 2000x2000) Image search: [Google]
Python-logo-notext.svg.png
173 KB, 2000x2000
My teacher said that we have to make a game with python
I have never used pygame and have no idea how to begin
tell me some good ideas please
>>
>>51944339
make snake.

lel.
>>
Blackjack, Chess, Tetris, or something similar. You can't really make graphically demanding stuff with Python, nor should you even try if you are a beginner.

My first game was a simple tower defence with Java, it sucked but I felt like a champion once it was finished.

Sokoban-style games are also nice for beginner.
>>
it's for my final exam btw so it can't be something shitty
>>
>>51944366
thanks
I thought that a platformer is pretty good
it is hard to make one on python ?
>>
>>51944339
Does it have to use pygame?
>>
>>51944443
>so close
>>
>>51944443
No
he told us make a game with python and it's for your final exam
>>
>>51944339
My suggestion would be to type "pygame tutorial" into a search engine.
>>
>>51944339
https://github.com/search?l=Python&q=game&ref=searchresults&type=Repositories&utf8=%E2%9C%93
>>
programarcadegames.com/
Really great and thorough.
>>
Create a waifu sim.
>>
Use renpy and make some VN with qtπ
>>
>>51944339
Damn I wish I had teachers like yours.
>>
are u making something with actual graphics or just the terminal. if you're a beginner make hangman or s/t simple like that.
>>
>>51944508
Literally just make a pick a number or ASCII tic-tac-toe game. It will be less than 200 lines of code. Maybe less than 100 if you're L33T.
>>
had to make a game a year ago using pygame.

kinda easy, just be sure to start asap, that was the hardest thing to do for me.

also, use some free graphics/music to pretty it up, easily prettys up a otherwise lackluster game.
>>
here faggot

import pygame, random, sys
from pygame.locals import *
def collide(x1, x2, y1, y2, w1, w2, h1, h2):
if x1+w1>x2 and x1<x2+w2 and y1+h1>y2 and y1<y2+h2:return True
else:return False
def die(screen, score):
f=pygame.font.SysFont('Arial', 30);t=f.render('Your score was: '+str(score), True, (0, 0, 0));screen.blit(t, (10, 270));pygame.display.update();pygame.time.wait(2000);sys.exit(0)
xs = [290, 290, 290, 290, 290];ys = [290, 270, 250, 230, 210];dirs = 0;score = 0;applepos = (random.randint(0, 590), random.randint(0, 590));pygame.init();s=pygame.display.set_mode((600, 600));pygame.display.set_caption('Snake');appleimage = pygame.Surface((10, 10));appleimage.fill((0, 255, 0));img = pygame.Surface((20, 20));img.fill((255, 0, 0));f = pygame.font.SysFont('Arial', 20);clock = pygame.time.Clock()
while True:
clock.tick(10)
for e in pygame.event.get():
if e.type == QUIT:
sys.exit(0)
elif e.type == KEYDOWN:
if e.key == K_UP and dirs != 0:dirs = 2
elif e.key == K_DOWN and dirs != 2:dirs = 0
elif e.key == K_LEFT and dirs != 1:dirs = 3
elif e.key == K_RIGHT and dirs != 3:dirs = 1
i = len(xs)-1
while i >= 2:
if collide(xs[0], xs[i], ys[0], ys[i], 20, 20, 20, 20):die(s, score)
i-= 1
if collide(xs[0], applepos[0], ys[0], applepos[1], 20, 10, 20, 10):score+=1;xs.append(700);ys.append(700);applepos=(random.randint(0,590),random.randint(0,590))
if xs[0] < 0 or xs[0] > 580 or ys[0] < 0 or ys[0] > 580: die(s, score)
i = len(xs)-1
while i >= 1:
xs[i] = xs[i-1];ys[i] = ys[i-1];i -= 1
if dirs==0:ys[0] += 20
elif dirs==1:xs[0] += 20
elif dirs==2:ys[0] -= 20
elif dirs==3:xs[0] -= 20
s.fill((255, 255, 255))
for i in range(0, len(xs)):
s.blit(img, (xs[i], ys[i]))
s.blit(appleimage, applepos);t=f.render(str(score), True, (0, 0, 0));s.blit(t, (10, 10));pygame.display.update()


now fuck off
>>
Make a game where you put in your birthdate and get a jew name.
>>
make a game where you have to guess the computers number between 1 and 100. then when you try, it tells you if it is higher/lower/bingo or smth like that
>>
Wasn't Civ IV made with python? I remember seeing python on the intro screen
>>
>>51944339
just write a short txt based rpg and cal it quits.
have it run in shell
>>
>>51944366
Please share the TD

t. curious about java games
>>
>>51944351
>>51944339

But call it python. Snake is a pretty easy game to make. I made snake as a hello world to sdl, it's fun!
>>
>>51953249
Python was used as a scripting language within it. Overall game was written in C++ iirc.
>>
For my intro to programming class we had to make a game with pygame and present it at a game expo. We made a pizza delivery game where the map was our campus and you could run people over and upgrade/heal your car. We got 1st place and I got a $20 scholarship (kek). pygame blows is all I'll say
>>
>>51944339

battleship wouldn't be a bad one

I did that in C using characters and it was quite fun.
>>
I made a simple game where you walk around and shoot monsters (like Gauntlet or Zelda) in pygame. It was pretty shitty, but it was more about learning to use the MVC pattern than making a good game
Thread replies: 28
Thread images: 1

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.