notes.dat 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. THINGS TO LEARN:
  2. - is there a better way to implement kbhit()?
  3. - is there a way to flush the input stream at the beginning of every cycle? (at present player keeps moving even if keys are not pressed)
  4. ##################################################################################################
  5. IDEAS AND DOUBTS:
  6. - what if we gave int speed to every game_object?
  7. - what if position (and speed) was not an integer but a double? (we could cast it to int when we upload the matrix)
  8. - we could keep the same refreshing rate and change the speed of enemies and bullets instead...low refresh_rate makes it horrible to play
  9. - bomb_list still to be implemented...
  10. - if picture was a std::vector<std::vector<char>> we would not have to delete it!
  11. - why does box destroy things? it's not its job! destroy() should be independent
  12. - some methods, some data members should be made private or protected..maybe..
  13. - we could remove dead enemies from the list so that boss appears if enemies.empty()==true ( no need to use enemyalive() ) <- tried and re-tried with remove_if but just failed and re-failed...
  14. - box::draw() should not have arguments. everything it needs should be passed through box::refresh()
  15. - dead enemies should not move
  16. - box.draw() should be called when new positions have been evaluated and before bullets and bombs are killed. this way players
  17. can see when they're hit or hit something. we could draw an "*" where explosions take place
  18. - capitals should be allowed, it's really bad when you hit caps lock while playing and player stops moving...
  19. - toupper(command) and fflush(stdin) could be solutions to bugs 1 and 4
  20. - shots are not centered!! (because player is now 8 spaces long)
  21. - why is choose_level()'s variable "level" a char? why not just an integer?
  22. ##################################################################################################
  23. KNOWN BUGS:
  24. - keeping the same command pressed for some time makes it impossible to use commands for a while
  25. (maybe fflush() can solve this????)
  26. - box's boundaries shift left when several objects are drawn in the same spot
  27. -MADERNA DOES NOT BEHAVE CORRECTLY! There is a fatal bug when she spawns that makes all the boundaries to shift! (only the first line of the boss actually moves, the rest remains stuck)!
  28. ##################################################################################################
  29. PROBLEMS/BUGS FIXED IN V 4.1:
  30. - answering choose_level() with a character instead of a number makes it so that boss does not reset
  31. (every input should be checked!!) <- solved with a simple input check.
  32. - if caps lock is on, player cannot move (maybe toupper() can solve this???) <- solved with tolower().
  33. - really long nicknames can be entered <- solved with string::resize().
  34. - shootrate should increase as enemies die, otherwise there's very small chance that a single enemy will shoot. <- solved by substituting "rand()/RAND_MAX < shootrate" with "rand()/RAND_MAX < shootrate*ENEMY_NUM/n_alive_enemies", which grants that at every loop the amount of bullets shot remains constant and equal to shootrate*ENEMY_NUM.
  35. Here a brief explanation: if B is the amount of bombs we want the enemies to shoot per loop (and it is constant), B = p*n, where p is the probability of a single (alive) enemy to shoot a bomb and n is the number of living enemies. Since we want B to dipend from ENEMY_NUM (more enemies initially = more bombs are shot) B shall be also B = N*c, where N is ENEMY_NUM and c is a percentage (0<=c<=1); for example, if c=0.25, one quarter of the initial enemies will shoot at every loop. By imposing B=constant, p becomes N*c/n, therefore when n decreases (enemies die), p increases so that B remains the same (more than 1/4 of alive enemies will shoot, providing always B bombs per loop).