when trying to draw sprites using with-sprite-batch I get strange issues were it seems to draw parts of other sprite.
(define (render)
(with-sprite-batch
*batch*
(for-each
(lambda (sprite) (draw-entity sprite))
(append (list *player*)
*bullets*
*enemies*))))
'bullets' is a list that the bullets are added to when they are fired
'enemies' is a list that enemies get added to when they are spawned
full code can be found at https://github.com/blob626/square-man/tree/sprite-batch
I have three different textures, bullet.png (form the examples), player.png (64x64 yellow square), and enemy.png (64x64 red square).
when shooting bullets the bullet sprite appears but it sees to be above a portion of player sprite, so its aa yellow square the size of the bullet sprite with the bullet sprite on top of it. these little yellow squares move with the bullet but sometuimes seem to stay in one place. after a while. only some shots will have this effect, others will appear as expected.
The enemy move across the screen from right to left, it sees to be shadowed by some player sprite, if an enemy has been spawned all the squares made by the bullets will become red and any further bullets fired will be red with the same yellow shadow as the enemy.
![sprite-batch-bug01](https://camo.githubusercontent.com/d093c19c028c519d1a3e166ee538da3458e07e5911a2602cd7927d4956819da0/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f3335363038362f313032323133382f64663662336166632d306436332d313165332d393335352d3061333632343234376232622e706e67)
![sprite-batch-bug02](https://camo.githubusercontent.com/3db98b91bed20015e813486931f93e12a3f5cd40df9a51ac16cc6ee15066cbf0/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f3335363038362f313032323133392f64666465333766302d306436332d313165332d386134312d6330663039323031303235382e706e67)
![sprite-batch-bug03](https://camo.githubusercontent.com/8c75d25e376baac4749b40d9b307baecac7499988cd95515bdecfcc05369900b/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f3335363038362f313032323134302f65303039623864302d306436332d313165332d383262372d3135326565383732313337332e706e67)
This is probably because the number of sprites changes as you shoot and spawn enemies, so either I shouldn't be allowed to do that, in which case something should be said about it. If so then is there a suggestion for a better way to do (adding sprites dynamically, such as shooting and spawning enemies)