Jump to content

Richard Simpson

Members
  • Posts

    409
  • Joined

  • Last visited

Posts posted by Richard Simpson

  1. I did try this, but it's still not colliding :) I removed the "positionentity level1,vec3(0,-2,0)" and then added in the line you posted. I added that line in here...

     

     

    '--------Create physics bodies--------
    playerbody:TBody = createbodybox()
    positionentity(playerbody,vec3(0,5,0))
    setbodymass playerbody,1
    EntityParent player,playerbody
    
    
    entitytype playerbody,1
    entitytype level1,1
    collisions 1,1,True

     

    The created body does drop down, but it just wont collide with the level.

  2. I'm playing around with blitzmax again and doing the tutorials. I'm stuck with collisions now though as I am trying to use my own mesh with a PHY file. I want a box created with code to collide with my sbx scene I have loaded. Here is the code: (I have left in the lines where I have tried to use my level variable to create collision)

     

    'Load the leadwerks game engine framework
    Framework leadwerks.engine
    
    'Specify the app title
    AppTitle$ = "Test App"
    
    'Create a graphics window
    Graphics 1280,900
    
    'Register the abstract path
    registerabstractpath AppDir
    
    'Create world with error message if world fails to load
    If Not CreateWorld() RuntimeError "Failed to load the world."
    
    'Create a camera and position it
    camera:Tcamera = CreateCamera()
    PositionEntity camera,vec3(0,2,-6)
    RotateEntity camera,vec3(0,-30,0)
    
    'Create a light, position and rotate it
    sun:TLight = CreateDirectionalLight()
    PositionEntity sun,vec3(2,2,-2)
    RotateEntity sun,vec3(45,45,0)
    
    'Create the player
    player:TMesh = CreateCube()
    EntityParent camera,player
    
    'Load level 1
    level1 = LoadScene("abstract::level1.sbx")
    positionentity level1,vec3(0,-2,0)
    
    '--------Create physics bodies--------
    playerbody:TBody = createbodybox()
    setbodymass playerbody,1
    EntityParent player,playerbody
    
    
    entitytype playerbody,1
    entitytype level1,1
    collisions 1,1,True
    
    
    
    'Create a buffer
    buffer:TBuffer = CreateBuffer(1280,900,BUFFER_COLOR0|BUFFER_DEPTH|BUFFER_NORMAL)
    
    'Debug lights and physics
    debuglights(0)
    debugphysics(1)
    
    'Main loop
    While Not KeyHit(KEY_ESCAPE)
    
    'Move the player left and right
    If KeyDown(KEY_A) moveentity player,vec3(-0.06,0,0)
    If KeyDown(KEY_D) moveentity player,vec3(0.06,0,0)
    
    'Zoom camera in and out, reset camera position
    If KeyHit(KEY_NUM1) moveentity camera,vec3(0,0,1)
    If KeyHit(KEY_NUM2) moveentity camera,vec3(0,0,-1)
    If KeyHit(KEY_NUM0) positionentity camera,vec3(0,0,-6)
    
    
    'Update, render and flip the world
    updateworld()
    setbuffer buffer
    
    renderworld()
    setbuffer backbuffer()
    
    renderlights(buffer)
    Flip
    
    Wend
    

     

    Thanks! :)

  3. I've been trying to learn xcode using tutorials on youtube. But nothing seems to be sticking... Does anyone know of any good xcode tutorial sites or books that they have used and would recommend for a complete beginner like myself? Thanks!

  4. Take one of the OBJ files, and open phygen, then load the OBJ file and create a convex hull with this. Make sure you give the phy file the same name as your GMF model. I have never tried this with an animated mesh so not sure if it will work.

     

    Suggestion: Use an OBJ file where the zombie position isn't the "T" shape. This will allow the zombie to get closer to walls.

     

    I hope this works. :)

  5. Nice work both of you :( Very impressive.

     

    In answer to you comment Richard regarding the terrain editor, although it is awesome the fact that it's based on height maps means it can't do overhangs or arches etc. Looks like Sculptris could be really useful for modelling that sort of feature and used to embellish the Leadwerks terrains!

     

    Ah yeah, that's a good point!

  6. Ah cool, I struggle with the programming also. :( Even though sculptris is useful for sculpting terrains, I wouldn't use it for that, because Leadwerks has an awesome terrain editor! Post a pic of your octopus once its all painted please, I would like to see it! :D

  7. Yeah, but the specular is there to bring more contract in the color range. You should also darken the ambient a lot that it doesn't look so flat.

    In real even a matte rusty oildrum has a greate color spectrum, which can be only achieved with HDR+SSAO+specular+dark ambient:

    http://1.bp.blogspot.com/-6pWTuEIVdUQ/TgAPO2oBV5I/AAAAAAAAAEs/7T0_NfZEn9o/s1600/IMG_2833.JPG

     

    That is still nowhere near as shiny as the old LE one though. :)

×
×
  • Create New...