Search Result

Collapse
6 results in 0.0040 seconds.
Keywords
Members
Tags
pygame
  •  

  • Trolkar8
    started a topic Pixelperfect Collision, hitmask/blank error

    Pixelperfect Collision, hitmask/blank error

    I am trying to understand the way that pixelperfect collisions works, I have made a program using two circles(images) bouncing around in the pygame window. This is the script:
    Code:
    import pygame, importedfunctions, random
    pygame.init()
    clock = pygame.time.Clock()
    screen = pygame.display.set_mode([640,480])
    class BallClass(pygame.sprite.Sprite):
        def __init__(self, x,y):
            pygame.sprite.Sprite.__init__(self)
    ...
    See more | Go to post

  • How to test for collision with pygame corner, and drag selected corner?

    How do I test a collision between two Rect objects to see if one collides with the other at a certain position?

    Code:
    pseudocode ---
    
    if event.type == pygame.MOUSEBUTTONDOWN:
        if mouseRect(imageRect.bottomleft):
            action1()
        if mouseRect(imageRect.bottomright):
            action2()
    See more | Go to post

  • Pygame issue while using scrolling to "zoom in/out".

    i am attempting to use the scroll wheel to enlarge or shrink everything on the screen. But after I enlarge the images and try to shrink them, the images disappear completely and I can no longer "scroll in". Obviously I am not updating everything correctly, but I'm not sure what I did wrong.

    Also, I can't scroll in more than once...I was under the impression that I could make multiple calls to the function the way it's written,...
    See more | Go to post

  • Trolkar8
    started a topic Pygame program to executable error color dict?

    Pygame program to executable error color dict?

    I started to make a game using pygame.init() and wanted to test if it worked as an executable using py2exe so I made the an setup.py script which i called via cmd followed by py2exe
    setup.py
    Code:
    from distutils.core import setup
    import py2exe
    
    setup(console=['SKPD.py'])
    But after that when i try to run the program from the dist folder i get the error:
    Import Error: No module named colordict...
    See more | Go to post

  • Don't understand why my simple pygame script (draw rectangle) isn't working...

    The code works if I don't define the event loops, but when I DO define events, the screen isn't even generated.
    I initialized the pygame module before the loop.
    Code:
    #-------------------------------------------------------------------------------
    # Name:        module3
    # Purpose:
    #
    # Author:      office
    #
    # Created:     02/03/2012
    # Copyright:   (c) office 2012
    # Licence:     <your
    ...
    See more | Go to post

  • Pygame TypeError: python.surface object unsubscriptable

    I am trying to run some pygame code and get this error:
    Pygame TypeError: python.surface object unsubscriptable
    Here is the code:
    Code:
    ball1 = [ 100 ,50 , 1, 0]
    
    def ball (x,y,movex,movey):
        if x < 0 :
            x * -1
        if x > 580:
            x= x* -1
        if y < 0:
            y = y* -1
        if y > 260:
            y = y*-1
    
        x+= movex
    ...
    See more | Go to post
Working...