![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8DbLkJP2UuajQYw351Zf0jaqQa53J4NTJbz7Cyw2i_bqjbqhDiS_ygf9QPw5FWNFjawHjowSova0X_zfzZScwtyzfjSZR358-3c6W3aNt8sBGo6zLI_c_z8ntCT3hE-JGPNTyMrByIWGd/s1600/MiniJuego_Pantilla-de-Nuevo-Tutorial.png)
Descarga el archivo de este tutorial aquí:
https://drive.google.com/file/d/1JHkk4IKSaIx5YkE7cxWfHq21oXlB2YKZ/view?usp=sharing
La programación esta en las lineas siguientes:
from bge import logic as g, events
c = g.getCurrentController()
o = c.owner
teclado = g.keyboard.events
Motion=c.actuators ["Motion"]
c.activate(Motion)
move = 0.30
move2 = 0.05
loc = 0.00
rot = 0.00
if teclado[events.WKEY]:
loc = move
if teclado[events.SKEY]:
loc = -move
if teclado[events.AKEY]:
rot = move2
if teclado[events.DKEY]:
rot = -move2
Motion.dLoc = [0.0, loc, 0.0]
Motion.dRot = [0.0, 0.0, rot]
La programación esta en las lineas siguientes:
from bge import logic as g, events
c = g.getCurrentController()
o = c.owner
teclado = g.keyboard.events
Motion=c.actuators ["Motion"]
c.activate(Motion)
move = 0.30
move2 = 0.05
loc = 0.00
rot = 0.00
if teclado[events.WKEY]:
loc = move
if teclado[events.SKEY]:
loc = -move
if teclado[events.AKEY]:
rot = move2
if teclado[events.DKEY]:
rot = -move2
Motion.dLoc = [0.0, loc, 0.0]
Motion.dRot = [0.0, 0.0, rot]
0 comments:
Publicar un comentario