(Apr-15-2019, 11:41 PM)SheeppOSU Wrote: Can someone help me to fix that and one more thing, the sword doesn't deal damage until I stab through to the other side of the enemy. I tried to fix that problem but I couldn't figure out what I was doing wrong. Thx in advance.It is much easier to fix issues if we can run the game. This is going to require you to clean your code.
1) You have hard coded a path that is only available on your computer. As well as i am on linux, so there is not even a C drive even. It is much better to load from a sub-directory of the game directory. In that way it can be moved to any computer with a different operating system and run.
Quote:WoodBat = (pygame.image.load("C:/Users/Chadd/Desktop/Ayden Stuff/WoodenBat.png"), pygame.image.load("C:/Users/Chadd/Desktop/Ayden Stuff/WoodenBatRight.png"), pygame.image.load("C:/Users/Chadd/Desktop/Ayden Stuff/WoodenBatDown.png"), pygame.image.load("C:/Users/Chadd/Desktop/Ayden Stuff/WoodenBatLeft.png")) SpikeBat = (pygame.image.load("C:/Users/Chadd/Desktop/Ayden Stuff/Spiked_Bat.png"), pygame.image.load("C:/Users/Chadd/Desktop/Ayden Stuff/Spiked_BatRight.png"), pygame.image.load("C:/Users/Chadd/Desktop/Ayden Stuff/Spiked_BatDown.png"), pygame.image.load("C:/Users/Chadd/Desktop/Ayden Stuff/Spiked_BatLeft.png")) IronBat = (pygame.image.load("C:/Users/Chadd/Desktop/Ayden Stuff/MetalBat.png"), pygame.image.load("C:/Users/Chadd/Desktop/Ayden Stuff/MetalBatRight.png"), pygame.image.load("C:/Users/Chadd/Desktop/Ayden Stuff/MetalBatDown.png"), pygame.image.load("C:/Users/Chadd/Desktop/Ayden Stuff/MetalBatLeft.png")) IronSword = (pygame.image.load("C:/Users/Chadd/Desktop/Ayden Stuff/IronSword.png"), pygame.image.load("C:/Users/Chadd/Desktop/Ayden Stuff/IronSwordRight.png"), pygame.image.load("C:/Users/Chadd/Desktop/Ayden Stuff/IronSwordDown.png"), pygame.image.load("C:/Users/Chadd/Desktop/Ayden Stuff/IronSwordLeft.png")) DiamondSword = (pygame.image.load("C:/Users/Chadd/Desktop/Ayden Stuff/DiamondSword.png"), pygame.image.load("C:/Users/Chadd/Desktop/Ayden Stuff/DiamondSwordRight.png"), pygame.image.load("C:/Users/Chadd/Desktop/Ayden Stuff/DiamondSwordDown.png"), pygame.image.load("C:/Users/Chadd/Desktop/Ayden Stuff/DiamondSwordLeft.png"))
2) It is much easier to put your code up on github so people have access yo your resources. Read here for more info.
Doing this work will make it easier for people to help you along the way. I am a very visual person. I need to run the program and then follow your problems along the way, not just read through the code. I could switch over all your images to pygame surfaces. However you want the help. You are going to have to make it runnable for other people.
As a side note. Your numerous threads regarding this one program can be merged into one thread. After i merge these, please repost in the same thread if you come along another issue regarding this program.
Recommended Tutorials: