Skip to content
Permalink
Browse files
small collision update
  • Loading branch information
dacostag committed May 9, 2020
1 parent b13f3e3 commit 7f03e4bb0dc94bf0a2a9ebb2650ae93f42f5434c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 240 deletions.
195 first.py

This file was deleted.

11 main.py
@@ -1,6 +1,4 @@
import pygame
import random
import math
import os.path
from pygame import mixer
from sprites import *
@@ -84,14 +82,7 @@ class Game:
self.player.y = lowest.y + 1
self.player.vel.y = 0
# hitting blocks from the side
for hit in range(0, len(hits)):
if self.player.y > hits[hit].y:
if self.player.x < hits[hit].x:
self.player.x = hits[hit].x - 1
self.player.vel.x = 0
if self.player.x > hits[hit].x:
self.player.x = hits[hit].x + 1
self.player.vel.x = 0


# Die, by falling of the screen
if self.player.rect.bottom > height + 60:
@@ -1,16 +1,16 @@
............................................................
....P.....1.................................................
..........1.................................................
............................................................
............................................................
...............11...........................................
............................................................
....111.....................................................
...................111......................................
...........111..............................................
................111.............1111111111..................
...........111........................................P.....
................................1111111111..................
.................................................11111111...
.....111............11111111................................
1..........11111............................................
....................11111111................................
............................................................
1............................1..............................
111111111111111111111111111111..............................
..............................111111111111111111111111111111

This file was deleted.

0 comments on commit 7f03e4b

Please sign in to comment.