Questions for the ages...

Blitz3D Forums/Blitz3D Beginners Area/Questions for the ages...

Buggy(Posted 2006) [#1]
Would it be better to have a player\x#, player\y#, and player\z# type for each coordinate of each important object like in a lot of the samples, or should I just use EntityX( entity ), etc. instead?

Is there any real advantage to using the former?


mindstorms(Posted 2006) [#2]
I use player\x... because I can change it, then update the entity by using position entity. It really depends on what you are using it for. player\x will allow you to change it but needs the entity and the variable to be updated. entityx(entity) allows you to quickly access the x location without having to update it.


Steven Noyce(Posted 2006) [#3]
I have always used EntityX(entity), but I definately agree that it depends on the situation.


Buggy(Posted 2006) [#4]
If I used player\x, and used TranslateEntity or PositionEntity to move it, if I used the tween option in Renderworld, would the graphics not work smoothly?


mindstorms(Posted 2006) [#5]
the idea is to move the entity small amounts each "step", meaning changing the player\x by .01 or something like that. I usually also have a player\xVel wich I calculate and then add to the player\x to get what I want. This is a more 2d way to do things, but it works for me. It also helps to have a system like this for AI, to make them work better.

To answer your question, tweening should make it smoother by dividing whatever amount you change the x by a set number per time period. Instead of making one huge leap, it will make many smaller leaps faster.


Buggy(Posted 2006) [#6]
Sounds good to me!