Essentially, it involves throwing a block, and the player teleports wherever it lands. I have an ObjectId enum which stores my objects for the game. So far, I have a Block, Player, and Bullet (which is the thing you throw in the game) enum. Every new block/bullet that's created is passed its respective enum in its parameter. I use this tag to reference the objects.
Sorry but I'm a bit confused. Do you throw a bullet or a block?
Or do you mean you throw a bullet, that lands on a block, and then the player teleports to that block?
Either way, you need to reduce the number of objects you test for collision.
Physics/Collision libs usually have two phases for testing collisions: the broad phase and the narrow phase.
The broad phase is responsible for finding object pairs that are potentially colliding, and discarding the ones that are not.
This phase usually uses some form of spatial subdivision for the world (quadtrees, octrees, etc) and also tests for potential collisions between objects by using simple bounding volumes (like AABBs or OBBs) instead of the actual object's collision model (which can be much more expensive to test).
The narrow phase is where you check if two objects are actually colliding, using their actual bounding volumes (like you are doing in your code).
Summing it up, the broad phase very quickly and roughly discards non colliding object pairs, and the narrow phase performs the actual test to see if two objects are colliding.
This is much better explained in this article, that I came across a while ago.
It is a 3 part article that also contains physics and constraints, so give it a read if you're interested.
Yes this solves the problem. But makes another problem in some viewport sizes the line is thicker. It seems that there is no real solution to this problem
Yeah, but you can't really help that, if you view such a small graphic zoomed out, stuff like this will happen.
Have you tried mipmaps? You might get a better result with them.
Even if I solve this problem there is another problem. When zooming in or out at some viewport sizes the alignment of objects breaks. some objects may overlap. I tested this situation in gamemaker 8 and it has the alignment problem.
This, I can't really help, except you could enforce sizes for the viewport zooming, instead of allowing arbitrary zooming amounts.
What I mean is, allow zooming, but in 50% increments (or something along those lines), so that you can ensure it doesn't break the alignment.
Obviously, depending on what you're trying to do, this may not be possible (or wanted), but it's a thought.
The color change may happen due to the linear filtering, because by using linear filtering, you're averaging between the 4 closest texels, and, since most of the texture is blueish, the resulting color will also be blueish.
The odd line position thing, may also be somehow related to this (though I can't properly explain it).
Have you tried setting the minification filtering to nearest instead of linear, to see if the results improve? You could keep the magnification filter linear, so that, if you zoom in, the result will be linearly filtered.
Anyway, I'm not sure this is the case, but I hope it helps.