What is the meaning of constrain attribute and how to use it?
Flames.Inovation
Member Posts: 16
Any tutorials on what is constrain attribute and how can i apply it in my game?
Comments
A constrain is as it say. It constrains one set of data to another. So if I create a game level attribute that will store the value of say a specific actors X position on the screen, at all times,I can share that info with other actor's code, I would constrain the actor's position X, I want to track, to that game level attribute using a constrain. A constrain will constantly mirror the value.
So
I create a game level real attribute and call it main_actor_X
Constrain attribute main_actor_X to self.main_actor.position X
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Constrain = Change this attribute on every code / draw cycle, so if your game is running efficiently at 60fps, constrain is loosely equal to an every 0.0166 seconds Timer containing one change attribute behaviour.
Hope that makes sense.