Trouble debugging program

Trouble debugging program

Postby Hissing Cockroach » Tue Dec 24, 2013 2:58 am

Hi, I have made a program here:

https://github.com/HissingCockroach/Astroid-feild/blob/master/Asteroid%20Field.py


You might have to play this yourself to find out
what I'm talking about, but whenever I crash my ship
into an asteroid, and I select "Play Again", what the
program does is makes it so that when I crash my ship
again, the asteroid just moves off the ship, and nothing
happens. I've been trying to fix this for two days.
Could anyone help?
Last edited by Hissing Cockroach on Tue Dec 24, 2013 3:29 pm, edited 1 time in total.
User avatar
Hissing Cockroach
 
Posts: 108
Joined: Sat Sep 14, 2013 2:35 pm
Location: Earth

Re: Trouble debugging program

Postby hansn » Tue Dec 24, 2013 8:09 am

I would love to help out, but I don't want to spend my time trying to understand what all the 1-letter variable names represent. Your total lack of else and elif statements does not help either.

Seriously, you got variables u, d, t, i, f, l and p :shock:

I'm not mocking your code or anything I just think that you should make your code more readable before asking us to help you debug it.
hansn
 
Posts: 87
Joined: Thu Feb 21, 2013 8:46 pm

Re: Trouble debugging program

Postby dboxall123 » Tue Dec 24, 2013 11:26 am

Wow, you're still avoiding functions and classes?
dboxall123
 
Posts: 108
Joined: Fri Jul 12, 2013 5:28 pm

Re: Trouble debugging program

Postby metulburr » Tue Dec 24, 2013 1:56 pm

There comes a time when one must use functions/classes not because he thinks he should, but because others wont read his code without them. If this was your first or second time posting code, it would be a different story. But by now you should be at least implementing them into your code slowly. The only function you use is the one i handed to you. At this point i dont want to help, because i know that your code is going to be one long massive while loop, with no functions or classes. I dont want to keep debugging this type of code. I am pretty sure others might agree as well.

I and others, have already told you numerous times that you cannot start 2d game programming without knowing functions and classes. You must know the basics first. And you do not.

I dont mean to be harsh. Once you understand the concept of functions and classes it will make your coding life a lot easier, and those around you that help you.
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1299
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: Trouble debugging program

Postby Hissing Cockroach » Tue Dec 24, 2013 3:19 pm

metulburr wrote:I and others, have already told you numerous times that you cannot start 2d game programming without knowing functions and classes. You must know the basics first. And you do not.


I guess you're right, but I would need some good tutorials. Could you
please post some URLs?
User avatar
Hissing Cockroach
 
Posts: 108
Joined: Sat Sep 14, 2013 2:35 pm
Location: Earth

Re: Trouble debugging program

Postby Mekire » Tue Dec 24, 2013 3:50 pm

Honestly I have tried several times and yeah, I'm basically done. I have rewritten entire programs for you and offered to go through step by step in one of your programs until it was an acceptable structure.

You'll get no more help from me untill I see some actual effort (and no, doing more of the same does not qualify).

-Mek
User avatar
Mekire
 
Posts: 977
Joined: Thu Feb 07, 2013 11:33 pm
Location: Amakusa, Japan

Re: Trouble debugging program

Postby metulburr » Tue Dec 24, 2013 4:07 pm

I guess you're right, but I would need some good tutorials. Could you
please post some URLs?

viewtopic.php?f=25&t=5063
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1299
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY


Return to Game Development

Who is online

Users browsing this forum: No registered users and 2 guests