I am working on a game, and I am looking for constructive criticism on how can efficiency can be increased / minimize unecessary use of resources. Things to note: This is a version that I am happy to share with you guys. Some parts of the code are missing but it runs. Please bit everything apart and tell me how it can be improved !.
Also anyone who does pose critical comments I will reply to you and keep you on a list to credit when I am finished with the game. Please roast it !
I donât really know what you game is supposed to do but right now we canât move the player.
You need to modify your show() function of your Player class:
void show(int r, int g, int b) {
fill(r, g, b);
ellipseMode(CORNER);
ellipse(pos.x, pos.y, size, size); // You had ellipse(width/2, height/2, size, size);
update();
}
Also, the update part of a game loop is usually perfomed before displaying the result.
That the very old version ! I should have specified ! I was playing out there with stuff I am way ahead from that. For the current up to date look at the V_0020 branch and the HiScapes folder or the V_0015 HiScapes folder. There is the proper game to roast there !
The player movement seems âclunkyâ. The only way I can think to fix this is to use 4 separate booleans (maybe a boolean[] array) and set them true on keyPressed() and false on keyReleased(). That way the combined inputs wonât interfere and youâre player will be able to move in all directions with no fail
The player speed seems quite stiff. I think experimenting with momentum wouldnât hurt.
The âbackâ button in the join server menu does not work after one of the text boxes has been clicked
Iâm assuming youâre only drawing tiles that are on screen, but Iâm getting a framerate of about 35 when traversing the level. It was probably just my potato computer trying to draw all the tiles.
Still, I canât help but feel the speed can be improved (maybe quad trees? or clever usage of larger and fewer tiles)
@Benny Hacker thank you for the lovely suggestions ! I will definitely work on adding different Tiles sizes as I also do feature FPS drop in fullScreen. And will be also interested to see what quads are !
But coming around about the Player control if we look into the gameFrame class we can see that :
Are present these in the Player class do feature 4 boolean values with a âswitchâ statement layout. I also added as Sprites where glitching another layer of else if when the keys are true so you can move in different directions all the time. Maybe that causing the clunky appearance ?
UPDATE: The game finishing intentions is getting a huge redo ! This was supposed to be an open world hack-n-slash⌠But I have decided to make it into a medieval survive waves game ! I will be redoing my server class to allow up to 4 player to be present at once ! And swapping out the tiles as random generation will not need to apply anymore !