[LWJGL] Tile System: How to makes only certain tiles change

I was going to post another “Step back and learn basic Java” replies but I think I’ve done 3 or so if those for the op and it never sinks in.

When you start using private statics without knowing what static or private means, your really in a bad spot.

Yeah, I rarely use static fields except for maybe a camera or a Box2D world, I remember when I first made Pong I had set the paddles to static, couldn’t figure out why only 1 could be controlled.

It is best to avoid it unless absolutely necessary.

Static isn’t a terrible thing like you make it out to be…

If you have a value or field which is the same across a group of objects, and it will not change in the individual objects, make it static. It makes no sense to have every object have an instance of the same object?

Static isn’t evil. Please don’t encourage that thinking.

Static is evil. As we have witnessed here today on this altar (thread) of blood. If you don’t know what static is, don’t use it. Even if you know what static is, you probably shouldn’t use it.

Exceptions include:

  1. You know what you’re doing.
  2. You’re lazy and you know you’re shaking hands with the devil.

This falls under the lazy category. Lazy doesn’t necessarily mean wrong, though. Especially if you want to get things done.

2cents

I think its part of a design pattern and is actually good coding. How is it lazy to utilize the language more and conserve precious memory in the process? I see no issue using static as long as you know what you’re doing.

How is static lazy in any way? Name a situation in which static would be a viable solution to a problem where there is a more efficient solution that does not involve static.

Well… that might be stretching it a little. The key idea I was trying to get across was that static isn’t evil like swords and gibbo are saying, it should just be used with caution and moderation because it can and will break code very quickly and frequently. Doesn’t mean you can’t use it though, its not as if something static is going to wipe your hard drive and cause your computer to explode. Its your fault really if you can’t use statics correctly, not the language’s fault. Learn to use statics, and then you can decide whether or not its a bad part of the language.

That I agree with. If you know what you are doing then make use of it. It is there for a reason, and there is very rarely a situation in which you would use static without knowing what it does (static imports come to mind).