Anyone who played or watched Transformer surely knows how text is presented right? Its kinda a bunch of “alien” letters, and each of them turns letter by letter to real english phrases ( Translator). I am planning to build this effect into my game… Still experimenting with this blend, but i am still lost.
@@elmeunick9
Why did you feel the need to throw it in a post-render callback? His original code looks to be driven by an always pulse sensor.
On a side note: It seems to me that you’re trying to use another game engines programming paradims when using the BGE.
I’ve done this in the past, but have since discovered it is often easier to find out how an engine is intended to be programmed and run with that.
@Rockymadio
I believe the simplest change to your code to make it work is all of one line different:
from bge import logic as log
def main(c):
o = c.owner
sp = c.sensors["space"]
if "init" not in o:
o["alien"] = "XXXXXXXXXXXXX
XXXXXXXXXXXXX
XXXXXXXXXXXXX"
o["Text"] = o["alien"]
o["init"] = True
else:
if sp.positive:
msg = "This is an alien language"
mlen = len(msg)
if o['counter'] < mlen :
o['counter'] += 1
o["Text"] = msg[:o['counter']] + o["alien"][o['counter']:]
Just in case, here’s the logic bricks to support it: