Company of Heroes


ChatLog

First Previous 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 Next Last

user name message

pythonista24x7

Just change y

pythonista24x7

Thats easy

007bionicalman

Whathow

pythonista24x7

https://pastebin.com/x2FQ1J7z

xcomreborn

https://pastebin.com/

pythonista24x7

https://gist.github.com/sidharthshah/590142561696f1e404762379394d851f

pythonista24x7

Twitch won't allow me to share links

007bionicalman

Ty so much

pythonista24x7

``` import pygame pygame.init() screen = pygame.display.set_mode([500, 500]) running = True x = 250 y = 250 while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False if event.type == pygame.KEYDOWN: if event.key == pygame.K_LEFT: x -=10 if event.key == pygame.K_RIGHT: x +=10 screen.fill((255, 255, 255)) pygame.draw.circle(screen, (0, 0, 255), (x, y), 75) ```

pythonista24x7

Here is working example I've created from the tutorial

007bionicalman

Yes ok didn’t have glasses couldn’t see earlier

007bionicalman

What Did you see

007bionicalman

Tutorial above

007bionicalman

Tutorial https://realpython.com/pygame-a-primer/

pythonista24x7

This should draw it a different co-ordinate

pythonista24x7

Okay try this. screen.blit(player.surf, (50, 50))

simply_coh

What are you working on there doctor x?

007bionicalman

Ok

007bionicalman

The tutorial said to

pythonista24x7

screen.blit(sprite1, rect)

007bionicalman

@pythonista24x7 Thanks for the help

pythonista24x7

Try googling \"Pygame sprite not moving when key pressed [duplicate]\" find a stack overflow post

pythonista24x7

Try this: https://stackoverflow.com/a/65258397/549520

pythonista24x7

blit method is used to draw a object on the script

007bionicalman

Floats that’s html or css isn’t it

007bionicalman

I did so much research and problem solving I have no answers

pythonista24x7

You need to \"translate\" the player's x co-ordinate when left and right keys are pressed

pythonista24x7

Nope, it wont

pythonista24x7

The `blit` method need to be updated when key is pressed

007bionicalman

Oh

First Previous 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 Next Last