NCCA / cfgaa24programingassignment-Oshersh15

cfgaa24programingassignment-Oshersh15 created by GitHub Classroom
0 stars 0 forks source link

Feedback #2

Open jmacey opened 6 months ago

jmacey commented 6 months ago

Please upload your project ideas asap so I can give you feedback

jmacey commented 6 months ago

This is actually quite a complex project idea, and I think it will be quite complex to do.

You don't really need to have classes for a lot of the things that are going to be drawn as they could be loaded in from a mesh, the main issue would be getting the collision of the ball and the players. Typically this is done with a collision mesh of some sort to simplify the calculations.

If you want to do a game a bit like this I would start looking at a simple Bat and Ball game (or just the Goal keeper in fussball). to start with then if you have time make it more complex, you could also look at using Bullet Physics to make it more realistic.

jmacey commented 6 months ago

For the packman idea the maze can be loaded in from an image / map and the wall just cubes. The moving around is more to do with the generation of the camera and collision detection can be quite simple as you alredy have a map in memory from the image.

The AI for the ghosts is a lot harder and getting this to work is a good project there is lot online about it. This will be more doable than the other idea.

jmacey commented 6 months ago

Please decided upon a project asap and start to add design / classes so I can give feedback.

jmacey commented 5 months ago

Still no design / code added.

Oshersh15 commented 5 months ago

I am currently working on my Pac-man project but having problems with pushing it to here. I will try to sort it out

jmacey commented 5 months ago

Good start with the maze, you have added your build folder to the repo which is best not to do (as it is binary and changes a lot!) this makes reverting harder.

You maze loading works ok, but it may be a little over complex. For example you could load and process once and store a structure for each block which contains the positions etc.

Better still store the data in a 2D array, and use this as a proxy for everything in the game. For example your collision detection could be based on this proxy map as you can only travel on an area where there is no wall, your AI can also use this.

For example if you have something like this

char maze[depth][witdh]={
{'w','w','w','f','w','w'},
{'w','w','w','f','w','w'},
{'w','f,'f','f','w','w'},
{'w','f','w','w','w','w'}
};

Where w is a wall, f is the floor etc, you can then add a 'p' in for the player and 'e' for enemy, all your processing is then done on this proxy which you then render when needed.

jmacey commented 5 months ago

Try not to hard code paths like this

        QImage image("/home/s5301744/repos/cfgaa24programingassignment-Oshersh15/image/Maze.png");

As they don't work on other machines. If you are having issues you need to add a copy function to your CMakeLists.txt so it copies the image folder. You can do this by changing the copy shaders function.

add_custom_target(${TargetName}CopyShaders ALL
    COMMAND ${CMAKE_COMMAND} -E copy_directory
    ${CMAKE_CURRENT_SOURCE_DIR}/shaders
    ${PROJECT_BINARY_DIR}/shaders
    COMMAND ${CMAKE_COMMAND} -E copy_directory
    ${CMAKE_CURRENT_SOURCE_DIR}/image
    ${PROJECT_BINARY_DIR}/image
    )

Once you have done this you can

  QImage image("image/Maze.png");
jmacey commented 5 months ago

some good progress, I would suggest that having your file includes.h is actually not a good idea (and considered bad practice), each .cpp / .h file should contain what it needs and not be in an external file (as it can cause issues with translation units).

For the camera movement I would suggest writing a camera class to make things easier. It will do all the calculations but then when required you can ask it for a matrix for the view (and project combined if needed). This will make it easier to use. Have a look at the first person on in some of my demos for an example.