Hi !
First, i want to tell u that my english is’nt good, so sorry for that from high. [I am from Poland, be scared ]
I do my application, speccialy:
from math import pi, sin, cos
from direct.showbase.ShowBase import ShowBase
from direct.task import Task
from direct.actor.Actor import Actor
from direct.interval.IntervalGlobal import Sequence
from panda3d.core import Point3
class MyApp(ShowBase):
def __init__(self):
ShowBase.__init__(self)
# Disable the camera trackball controls.
self.disableMouse()
# Load the environment model.
self.environ = self.loader.loadModel("models/environment")
# Reparent the model to render.
self.environ.reparentTo(self.render)
# Apply scale and position transforms on the model.
self.environ.setScale(0.25, 0.25, 0.25)
self.environ.setPos(-8, 42, 0)
# Add the spinCameraTask procedure to the task manager.
self.taskMgr.add(self.spinCameraTask, "SpinCameraTask")
# Load and transform the panda actor.
self.pandaActor = Actor("models/panda-model",
{"walk": "models/panda-walk4"})
self.pandaActor.setScale(0.005, 0.005, 0.005)
self.pandaActor.reparentTo(self.render)
# Loop its animation.
self.pandaActor.loop("walk")
# Create the four lerp intervals needed for the panda to
# walk back and forth.
pandaPosInterval1 = self.pandaActor.posInterval(10,
Point3(0, -10, 0),
startPos=Point3(0, 10, 0))
pandaPosInterval2 = self.pandaActor.posInterval(7,
Point3(0,3,0),
startPos=Point3(0,-10,0))
pozycja3 = self.pandaActor.posInterval(5, Point3(0, 10, 0), startPos=(0, 3, 0))
pandaHprInterval1 = self.pandaActor.hprInterval(1,
Point3(180, 0, 0),
startHpr=Point3(0, 0, 0))
pandaHprInterval2 = self.pandaActor.hprInterval(3,
Point3(180, 0, 0),
startHpr=Point3(180, 0, 0))
ang3 = self.pandaActor.hprInterval(2.5, (0, 0, 0), startHpr=(90, 0, 0))
# Create and play the sequence that coordinates the intervals.
self.pandaPace = Sequence(pandaPosInterval1,
pandaHprInterval1,
pandaPosInterval2,
pandaHprInterval2,
pozycja3,
ang3,
name="pandaPace")
self.pandaPace.loop()
# Define a procedure to move the camera.
def spinCameraTask(self, task):
angleDegrees = task.time * 20.0
angleRadians = angleDegrees * (pi / 180.0)
self.camera.setPos(20 * sin(angleRadians), -20.0 * cos(angleRadians), 3)
self.camera.setHpr(angleDegrees, 0, 0)
return Task.cont
app = MyApp()
app.run()
Then i wanted to pack it to p3d., without any issueses[?]
[i packed it with models]
Then i wanted to transform it to .exe , i didnt know what was better, so i first did installer [15 minutes :O]
I was happy ! I created an installer for windows, and i installed it…
Whe i wanted to run myfirsgame.exe i saw only the black window… and app just closed…
wtf ?
when i run this code, by python code, i mean:
ppython game.py
the game is running without any problems…
i Have two versions of python on my computer: The newest [3.5] and the 2.7 on panda3d folder…
both are in PATH…
Can you tell me what i’m doing wrong ?