I have an *Enemy* in my game that moves Left and Right with the default Platform behaviour, with an instance variable the toggles in the code.
-> When var "LEFT" = 1
-> Simulate control moving left
-> When var "RIGHT" = 1
-> Simulate control moving right
I am assuming that these both run at 60 times a second as default. The behaviour of the enemy is that he should keep running LEFT until he hits a *Block* then he goes RIGHT. Here's where it gets intensive - there are usually about 50 - 200 blocks in the game at any one time, so if he's always checking collision with *Block* it generates "60*#ofBlocks" collision checks per second, per *Enemy*.
Is there a better way of checking collision so that it doesn't swamp my game down whenever these enemies are put in?
P.S. - *Enemy* is 128 pixels wide. Would checking his X - 64, X + 64 for an instance of block work better?