Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!news.skynet.be!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'position,': 0.04; 'mouse': 0.07; 'rewrite': 0.07; 'stops': 0.07; 'python': 0.09; '(0,': 0.09; '0),': 0.09; 'cursor': 0.09; 'moving.': 0.09; '(where': 0.15; 'folks': 0.15; 'sat,': 0.15; 'class:': 0.16; 'invisible': 0.16; 'pygame': 0.16; 'subject:Pygame': 0.16; 'trail.': 0.16; 'wrote:': 0.17; 'alex': 0.17; 'drawing': 0.17; 'yield': 0.17; 'all,': 0.21; 'statement': 0.23; 'second': 0.24; 'header:In-Reply-To:1': 0.25; 'skip:" 20': 0.26; 'separate': 0.27; 'library.': 0.27; 'message- id:@mail.gmail.com': 0.27; "doesn't": 0.28; 'subject:/': 0.28; 'all.': 0.28; 'fine': 0.28; 'position.': 0.30; 'code': 0.31; 'problem.': 0.32; 'file': 0.32; 'running': 0.32; 'rid': 0.33; 'turns': 0.33; 'problem': 0.33; 'to:addr:python-list': 0.33; 'code:': 0.33; 'received:google.com': 0.34; 'replaced': 0.35; 'doing': 0.35; 'pm,': 0.35; 'received:209.85.220': 0.35; 'received:209.85': 0.35; 'there': 0.35; 'explain': 0.36; 'but': 0.36; 'should': 0.36; 'problems': 0.36; 'keeps': 0.37; 'two': 0.37; 'being': 0.37; 'previous': 0.37; 'received:209': 0.37; 'well.': 0.37; 'subject:: ': 0.38; 'green': 0.38; 'files': 0.38; 'delete': 0.38; 'to:addr:python.org': 0.39; 'where': 0.40; 'help': 0.40; 'first': 0.61; 'here:': 0.62; 'is.': 0.62; 'leaving': 0.62; 'ever': 0.63; 'making': 0.64; 'here': 0.65; 'soon': 0.70; '2013': 0.84; 'bounded': 0.84; 'replacements': 0.84; 'to:name:python': 0.84; 'updated,': 0.84; 'email addr:gmail.com)': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type:content-transfer-encoding; bh=59fWUQ5RoPgU9Ny/oe1Y0NvJYu1DGmjVrYKDqttkI6Q=; b=WzuFkIkGVrJONaijTIKoIpha50LTK9uPrAQxTtQMpT/pRrjjmKuT7bSo1dw6TkgI+1 AxcJUSE/UOAcVNzK3EZNk23Khz3vpr8HvnCNg/znAboBuZmLtvbQ10IctlK6NK8TqER/ q+26pqFJVaXYoyJClObDB4mXL/gfKQWwPXMj2iW1JiAxtmWpUbS5r2VG10548NkOMB2y rzsSBV79xLOvz97YTmYynbZeLHcrXi+EPdQ7qQMY+T4eNxlETbfT/15N+EMaqaVmg/yE 9V8Z69cf+9mvg6cmD1PDiVCnm1dqXzCkhvN65hZIDkn5Sh1aD8vhkTGkyuDgRZR1Lunt jTPQ== X-Received: by 10.52.76.103 with SMTP id j7mr3338894vdw.90.1362943449395; Sun, 10 Mar 2013 12:24:09 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Ian Kelly Date: Sun, 10 Mar 2013 13:23:29 -0600 Subject: Re: Pygame mouse cursor load/unload To: Python Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 47 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1362943457 news.xs4all.nl 6852 [2001:888:2000:d::a6]:49686 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:41036 On Sat, Mar 9, 2013 at 5:25 PM, Alex Gardner wrote: > On Saturday, March 2, 2013 7:56:31 PM UTC-6, Alex Gardner wrote: >> I am in the process of making a pong game in python using the pygame lib= rary. My current problem is that when I move the mouse, it turns off as so= on as the mouse stops moving. The way I am doing this is by making the def= ault cursor invisible and using .png files as replacements for the cursor. = Perhaps my code would best explain my problem. I will take help in any wa= y that I can. Here are the links that contain my code: >> >> >> >> Main class: http://pastebin.com/HSQzX6h2 >> >> Main file (where the problem lies): http://pastebin.com/67p97RsJ >> >> >> >> If the links yield nothing, please let me know (agardner210@gmail.com) > > I would like to bother you fine folks one last time! There are drawing p= roblems that I am running into. The paddle keeps on moving but it doesn't = rewrite the black paddle. This is a problem because the paddle just keeps = leaving a green trail. The code is here: http://pastebin.com/gVPPJYWs > > I feel as though I am missing something... You get the streaking because the first blanking operation only ever blanks at (0, 0), and the second one blanks at the new paddle position, not the previous position. You don't need two separate rects to keep track of where the paddle is. blank_rect and b_bounds_rect are entirely unnecessary, so get rid of them. The line "screen.blit(bpaddle, paddle_pos)" should be replaced with "screen.blit(bpaddle, paddle_rect)", because paddle_rect is what you're using to track the paddle location. Since paddle_pos is not being updated, the former would always draw the blank paddle in the upper-left corner. This should also be the only place where you're blanking the paddle, so get rid of the other one. You also don't need the if statement at all. The clamping operation already ensures that the paddle is bounded to the region (0, 0, 300, 300). Once that's gone, you no longer need paddle_pos at all, so you can delete that as well.