PlaceholderGames / 2020-yr1-group-7

CS1S464 2020 Group 7
1 stars 0 forks source link

Review of Enemy code so far - early days I know - as I was asked #18

Closed DoctorMikeReddy closed 4 years ago

DoctorMikeReddy commented 4 years ago

I note that the Enemy code currently puts the NPC on screen, but relative, so that if the player moves, it is moved too; that is, it appears to be placed on screen at the same location all the time: image and image This is because the render function requires the camera to be passed as an attribute, the same as rendering objects or the player

nimshi89 commented 4 years ago

Yes I didn't notice that. Will correct it as soon as I can.

nimshi89 commented 4 years ago

@30001606VA Hey man :) so I think the problem is that how the NPC is rendered on the screen it is taken as a constant position rather then just a starting position. Like every time the character is re-rendered to that starting point. Would you like to have a try to fix it? :)

DoctorMikeReddy commented 4 years ago

I think if you look, the render function for Player, etc, includes passing camera data. But NPC does not use this. It might need adding @30001606VA

nimshi89 commented 4 years ago

I and Victor had a look at the code today and fixed the issue :) I had a bad approach when I created the enemy class and thought the camera is only needed for the player.