Ask coding questions

← Back to all posts
How do i fix the speed of the enemies
Fantasticben (1)

Before the enemies (green) walked at a slower speed closer to the player now they are moving really fast can someone help me please

Answered by malvoliothegood (797) [earned 5 cycles]
View Answer
Comments
hotnewtop
malvoliothegood (797)

It looks like you have got three timers responsible for moving the enemies. These can compound. Try commenting out them out one at a time and see if the enemies slow down.

Fantasticben (1)

@malvoliothegood do you by any chance know how I make my game go from level 2 to level 3 because currently after you complete level 1 you go to level 2 and after you complete level 2 it doesn't go to level 3 level 2 is looped

malvoliothegood (797)

@Fantasticben I find it a bit hard to understand your game. For example, what is the significance of the number 24? Have you got a design document (detailed overview of the game) that you can share?

I think you are making a great effort and you are to be commended for it !8:-)). However, if I was making the game I would design it a bit differently. For example, I would define your classes in separate files that could be imported into into main.py. The same could be said for your various lists. I can sort of see why you are designing it the way you are though.

Fantasticben (1)

@malvoliothegood thank you the significance of the number 24 is that each block is 24 by 24 so when I move the player they move 1 block to the right, left,up or dog

malvoliothegood (797)

@Fantasticben Thanks for that info. After looking more closely at your code I figured that this was the likely reason.

RhinoRunner (633)

I ran this and it said Player died!. Then it gave me an incredibly massive error. idk whats wrong with your code but i recommend you debug it

RhinoRunner (633)

@Fantasticben go through every line and maybe ask a stackoverflow question. Stackoverflow will give you the best answers

RhinoRunner (633)

@Fantasticben level 2 is impossible because the enemy doesnt move

Fantasticben (1)

@RhinoRunner that was a mistake I fixed it

Fantasticben (1)

@RhinoRunner do you by any chance know how I make my game go from level 2 to level 3 because currently after you complete level 1 you go to level 2 and after you complete level 2 it doesn't go to level 3 level 2 is looped

RhinoRunner (633)

@Fantasticben the enemy still doesnt move at level 2

Fantasticben (1)

@RhinoRunner I removed the enemy from level 2

RhinoRunner (633)

@Fantasticben its still there
also, why are there comments explaining everything?

Fantasticben (1)

@RhinoRunner I'm still here it's a project and I have to comment my code

Fantasticben (1)

@Fantasticben Try reloading the page i'm pretty sure it's gone

RhinoRunner (633)

@Fantasticben OK now all the files are gone. There is no main.py or images im confused

nevermind it works

RhinoRunner (633)

@Fantasticben When I ran it it went lvl1->lvl2->lvl3
seems fine
it crashed when I got the treasure on lvl 3 but thats because theres no other level.

Fantasticben (1)

@RhinoRunner yeah I'm going to add more levels later