Re: Strange class issue, bgt.

Your code is very hard to read. If you'd do all the work in the spikeloop, I think the problem would be solved. I don't see the need for the spike hit me variable, either. Even better would be if you used classes way more. example: if enemies and player were subclassed from the same superclass, you could have an array of all living beings and in the spike loop you'd loop over that array and hit anyone in range. The way this would work is that you handle all keyboard input like moving, in the player class, maybe in a function like update. In the enemy class the update function could be much simpler and simply make the enemy move towards the player.

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : redfox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : SkyLord via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : cmerry via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : roelvdwal via Audiogames-reflector

Reply via email to