this is a small part of my code where i created the collision but the issue is that it still doesnt work i have used also the distance formula to figure out the collision still nothing showed up;
please look at the screenshot and help!
Gilbertsilva123 30 Light Poster
Recommended Answers
Jump to PostI'd add a print statment to see exactly what is happening. If you are using a debugger with breakpoints then also add one at the start of your
dead
function.collision = isCollision(fighterX[i], fighterY[i], playerX, playerY) if collision: dead() collision = isCollision(fighterX[i], fighterY[i], bulletX, bulletY) if …
Jump to Postthe code u showed me only calcualates distance but collision doesn't happen
It returns True if the objects are closer than 27 units apart. I presume your object positions are defined by a centre point. In that case you should probably pass the object widths (or radii) and …
Jump to PostI don't understand. File, menu, and introduction are (up to) three distinct things. If you just want a text based introduction you could always put it in a python module as a triple-quoted (multi-line) string like
intro = """ It returns True if the objects are closer …
Jump to Postfrom Settings import * thats is what i was asking about to create a different file and import it in a different file.
I've never gotten into the finer points of setting up modules for import so I can't explain how they work. However, what I did for …
Jump to PostGlad I could help.
All 18 Replies
Gilbertsilva123 30 Light Poster
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
rproffitt commented: Science. +1 +15
Gilbertsilva123 30 Light Poster
Gilbertsilva123 30 Light Poster
Gilbertsilva123 30 Light Poster
Gilbertsilva123 30 Light Poster
rproffitt commented: Could be a size issue. Make the bullet huge as a test. +15
Gilbertsilva123 30 Light Poster
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Gilbertsilva123 30 Light Poster
Gilbertsilva123 30 Light Poster
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Gilbertsilva123 30 Light Poster
Gilbertsilva123 30 Light Poster
Gilbertsilva123 30 Light Poster
Gilbertsilva123 30 Light Poster
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Gilbertsilva123 30 Light Poster
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.