Project in work.

[color=green]I’m posting this coding of my project for personal refrences. It’s not complete, and you need to download the wav if you want the music. I’m making this into a role playing game, and I want to know the code so that I can transfer it from the computers at my school. To what I have at my house. I’ll post again when I get at least a little bit of the game done. Here’s what I have so far:

import direct.directbase.DirectStart
from direct.showbase import DirectObject

from threading import Timer

from direct.task import Task
from direct.actor import Actor
from direct.interval.IntervalGlobal import *
import math

import direct.directbase.DirectStart
from direct.task import Task
from direct.actor import Actor
from direct.interval.IntervalGlobal import *
import math
import direct.directbase.DirectStart
from direct.gui.OnscreenText import OnscreenText
from direct.gui.DirectGui import *
import direct.showbase.RandomNumGen
import random
from direct.interval.IntervalGlobal import *

bk_text = "Vertu Honagan"
textObject = OnscreenText(text = bk_text, pos = (-0.95,-0.95),
scale = 0.04, fg=(0,5,0,1),align=TextNode.ACenter,mayChange=1)

def incBar(args):
    bar['value'] += args
    text = "Progress is:"+str(bar['value'])+'%'
    textObject.setText(text)
def incBar1():
    bar['value'] += 10
    text = "Progress is:"+str(bar['value'])+'%'
    textObject.setText(text)

bar = DirectWaitBar(text = "Health" , value=100,pos=(-0.90,0,0.94), scale=0.4)
#props = WindowProperties()
#props.setCursorHidden(1)
#base.win.requestProperties(props)
window=base.openWindow()
class World(DirectObject):
    def __init__(self):

        land = loader.loadModel("models/environment") 
        land.reparentTo(render) 
        land.setScale(1,1,1) 
        land.setPos(-8,42,0)
        
        self.backgroundMusic = loader.loadSfx("mortal")
        self.backgroundMusic.setLoop(True)
        self.backgroundMusic.setVolume(1)
        self.backgroundMusic.play()

        def playMusic():
            self.backgroundMusic = loader.loadSfx("mortal")
            self.backgroundMusic.setLoop(True)
            self.backgroundMusic.setVolume(1)
            self.backgroundMusic.play()
        self.accept("m",playMusic)
        def stopMusic():
            self.backgroundMusic.stop()
        self.accept("n",stopMusic)
        def close():
            base.closeWindow(window)
        self.accept("c", close)

w=World()

textObject = OnscreenText(text = 'Mohanaki', pos = (0.7,0.9725), scale = 0.04)
run()

[color=green]If you see a bug in what I have right now please tell away.

[color=green]This is that coding added in with the stuff that I’ve had here at the my house. It’s predominately farther, but there’s still lots of work ahead of me.

import direct.directbase.DirectStart
from direct.showbase import DirectObject

from threading import Timer

from direct.task import Task
from direct.actor import Actor
from direct.interval.IntervalGlobal import *
import math

import direct.directbase.DirectStart

from direct.task import Task
from direct.actor import Actor
from direct.interval.IntervalGlobal import *
import math
import direct.directbase.DirectStart
from direct.gui.OnscreenText import OnscreenText
from direct.gui.DirectGui import *
import direct.showbase.RandomNumGen
import random
from direct.interval.IntervalGlobal import *
import direct.directbase.DirectStart

bk_text = "Vertu Honagan"
textObject = OnscreenText(text = bk_text, pos = (-0.95, -0.95),
scale = 0.04,fg=(0,5,0,1),align=TextNode.ACenter,mayChange=1)

def incBar(args):
    bar['value'] += args
    text = "Progress is:"+str(bar['value'])+'%'
    textObject.setText(text)
def incBar1():
    bar['value'] += 10
    text = "Progress is:"+str(bar['value'])+'%'
    textObject.setText(text)

bar = DirectWaitBar(text = "Vertu Honagan" , value=100,pos=(-.90,0,.94), scale=.4)
window=base.openWindow()
class World(DirectObject):
    def __init__(self):
        self.backgroundMusic = loader.loadSfx("mortal") 
        self.backgroundMusic.setLoop(True) 
        self.backgroundMusic.setVolume(1) 
        self.backgroundMusic.play()
        environ = loader.loadModel("models/environment")
        environ.reparentTo(render)
        environ.setScale(.25,.25,.25)
        environ.setPos(-8,42,0)

        myFog = Fog("the fog") 
        myFog.setColor(2,1,3) 
        myFog.setExpDensity(.005) 
        render.setFog(myFog) 
        def clearFog():
            render.clearFog()
        self.accept("c", clearFog)
        def fog():
            myFog = Fog("the fog") 
            myFog.setColor(2,1,3) 
            myFog.setExpDensity(.005) 
            render.setFog(myFog)
        self.accept("f", fog)
        pandaActor = Actor.Actor("models/panda-model",{"walk":"models/panda-walk4"})
        pandaActor.setPos(0,10,0)
        pandaActor.setScale(.005,.005,.005)
        pandaActor.reparentTo(render)
        
        pandaPosInterval1= pandaActor.posInterval(13,Point3(0,-10,0),startPos=Point3(0,10,0))
        pandaPosInterval2= pandaActor.posInterval(13,Point3(0,10,0),startPos=Point3(0,-10,0))
        pandaHprInterval1= pandaActor.hprInterval(13,Point3(180,0,0),startHpr=Point3(0,0,0))
        pandaHprInterval2= pandaActor.hprInterval(13,Point3(0,0,0),startHpr=Point3(180,0,0))
        pandaPosInterval3= pandaActor.posInterval(13,Point3(0,10,0),startPos=Point3(0,10,0))
        pandaPosInterval4= pandaActor.posInterval(13,Point3(0,0,0),startPos=Point3(0,10,0))

        monsterActor=Actor.Actor("models/monster1",{"attack":"models/monster1-pincer-attack-right"})
        monsterActor.setPos(10,0,5)
        monsterActor.setScale(1,1,1)
        monsterActor.reparentTo(render)
        
        monsterPosInterval1= monsterActor.posInterval(12,Point3(10,0,5),startPos=Point3(10,0,5))
        monsterPosInterval2= monsterActor.posInterval(10,Point3(12,0,5),startPos=Point3(12,0,5))

        def move():
            monsterAttack = Sequence(monsterPosInterval1, monsterPosInterval2, name = "monsterAttack")
            monsterAttack.loop()
            monsterActor.loop("attack")
            pandaPace = Sequence(pandaPosInterval1, pandaHprInterval1, pandaPosInterval2, pandaHprInterval2, name =           

            "pandaPace")
            pandaPace.loop()
            pandaActor.loop("walk")
        self.accept("d", move)
        def stop():
            monsterAttack = Sequence(monsterPosInterval1, name = "monsterAttack")
            monsterAttack.loop()
            monsterActor.stop()
            pandaPace = Sequence(pandaPosInterval3, name = "pandaPace")
            pandaPace.loop()
            pandaActor.stop()
        self.accept("s", stop) 
        def pawnMovement():
            pandaActor.setPos(pandaActor.getX(), pandaActor.getY()+1, pandaActor.getZ())
            pandaActor.play("walk")
        self.accept("p", pawnMovement)
        def playMusic(): 
            self.backgroundMusic = loader.loadSfx("mortal") 
            self.backgroundMusic.setLoop(True) 
            self.backgroundMusic.setVolume(1) 
            self.backgroundMusic.play() 
        self.accept("m",playMusic) 
        def stopMusic(): 
            self.backgroundMusic.stop() 
        self.accept("n",stopMusic)
        def close(): 
            base.closeWindow(window) 
        self.accept("c", close)
        
w = World()

textObject = OnscreenText(text = 'Mohanaki', pos = (0.7,0.9725), scale = 0.03)

run()        

Vertu_Honagan, just as a suggestion: Why don’t you post this stuff in a section where it belongs to? Here are (or better said: better should be) only topics that contain work that is either finished or at least already in a “amazing” state. This section isn’t a copy/paste section… (if I am wrong, please correct me.)

Don’t get me wrong, I don’t want to say “get the hell outta here”, but I would love to see to move this thread to the default Discussion section - or move the code to a web space of your own till you can “brag” with it.
This actual code isn’t all that bad, but, well… be honest. Its neither complete work nor is it on a level where you would normally love to tell ppl about it.

Thanks in Advance. If you have questions, please ask. :slight_smile:

Regards, Bigfoot29

[color=green]Yeah I have just one question. How do I move the thread or delete it?

If you want to move it, just tell us where to. If you want to delete it… I am not sure if you can do it yourself (tried it already?). Otherwise you can of course ask too. Anyways, I would love to move it instead of deleting. Good stuff is always welcome :wink:

Regards, Bigfoot29