Jump to content

Jazz

Members
  • Posts

    265
  • Joined

  • Last visited

Posts posted by Jazz

  1. Latest updates:

     

    Update: 12 Jan

     

    Added: Title Screen and music

    Added: Menu

    -resolution

    -music volume

    -restart level

    -exit to title screen

    Added: Level loading screen

    Fixed: Ball doesn't wobble after you throw it

    Changed: Increased blast force

    Changed: Levels and textures

     

    Update: 10 Jan

     

    Added: Sticky Bomb

    Added: Destructible blocks

    Fixed: Ball collision sound crash bug

    Fixed: Some sounds not stopping after level load

     

    Update: 8 Jan

     

    Fixed: timing and mouse issues with vsync off

    Added: music to level1

     

    http://www.leadwerks.com/werkspace/page/viewitem?fileid=833784148post-12583-0-26823000-1484248784_thumb.jpg

    • Upvote 1
  2. I never got it to work decently without modifying button.lua. Haven't used it for a long time but here's an old modified button.lua script.

     

    Script.pushed=false
    Script.hovered=false
    
    function Script:Draw(x,y,width,height)
       --System:Print("Paint Button")
       local gui = self.widget:GetGUI()
       local pos = self.widget:GetPosition(true)
       local sz = self.widget:GetSize(true)
       local scale = gui:GetScale()
    
       gui:SetColor(1,1,1,1)
    
       if self.pushed then
           gui:SetColor(0.2,0.2,0.2)
       else
           if self.hovered then
               gui:SetColor(0.3,0.3,0.3)
           else
               gui:SetColor(0.25,0.25,0.25)
               gui:SetColor(0.15,0.15,0.15,1.0,1)
           end
       end
    
    --    gui:SetGradientMode(true)
    --    gui:DrawRect(pos.x,pos.y,sz.width,sz.height,0,scale*3)
       gui:DrawRect(pos.x,pos.y,sz.width,sz.height,0,0)
    --    gui:SetGradientMode(false)
    
       if self.pushed then
           gui:SetColor(0.0,0.0,0.0)
       else
           gui:SetColor(0.75,0.75,0.75)
       end
       --gui:DrawLine(pos.x,pos.y,pos.x+sz.width,pos.y)
       --gui:DrawLine(pos.x,pos.y,pos.x,pos.y+sz.height)
    
       if self.pushed then
           gui:SetColor(0.75,0.75,0.75)
       else
           gui:SetColor(0.0,0.0,0.0)       
       end
       --gui:DrawLine(pos.x+1,pos.y+sz.height-1,pos.x+sz.width-1,pos.y+sz.height-1)
       --gui:DrawLine(pos.x+sz.width-1,pos.y+1,pos.x+sz.width-1,pos.y+sz.height)
    
       if self.hovered then
           gui:SetColor(51/255/4,151/255/4,1/4)
       else
           gui:SetColor(0,0,0)
       end
    --    gui:DrawRect(pos.x,pos.y,sz.width,sz.height,1,scale*3)
       gui:DrawRect(pos.x,pos.y,sz.width,sz.height,1,0)
    
       local text = self.widget:GetText()
       if text~="" then
           gui:SetColor(0.0,0.0,0.0)
           if self.pushed then
               --gui:DrawText(text,pos.x+scale+scale,pos.y+scale+scale,sz.width,sz.height,Text.Center+Text.VCenter)   
           else
               gui:DrawText(text,pos.x+scale,pos.y+scale,sz.width,sz.height,Text.Center+Text.VCenter)   
           end
           gui:SetColor(0.75,0.75,0.75)
           if self.pushed then
               gui:DrawText(text,pos.x+scale,pos.y+scale,sz.width,sz.height,Text.Center+Text.VCenter)   
           else
               gui:DrawText(text,pos.x,pos.y,sz.width,sz.height,Text.Center+Text.VCenter)   
           end
       end
    end
    
    function Script:MouseEnter(x,y)
       self.hovered = true
       self.widget:Redraw()
    end
    
    function Script:MouseLeave(x,y)
       self.hovered = false
       self.widget:Redraw()
    end
    
    function Script:MouseMove(x,y)
       --System:Print("MouseMove")
    end
    
    function Script:MouseDown(button,x,y)
       --System:Print("MouseDown")
       self.pushed=true
       self.widget:Redraw()
    end
    
    function Script:MouseUp(button,x,y)
       --System:Print("MouseUp")
       local gui = self.widget:GetGUI()
       self.pushed=false
       if self.hovered then
           EventQueue:Emit(Event.WidgetAction,self.widget)
       end
       self.widget:Redraw()
    end
    
    function Script:KeyDown(button,x,y)
       --System:Print("KeyDown")
    end
    
    function Script:KeyUp(button,x,y)
       --System:Print("KeyUp")   
    end
    

    post-12583-0-90158400-1483979846_thumb.jpg

  3. It may be stuck in attack mode calling the animation constantly. One-shot animations should only be called once. Adding System:Print("end animation") in your EndAttack function will show in the output window if it's getting called. You can try this script on the crawler prefab and see if it helps in any way.

     

    Script.mode = "idle"
    
    function Script:UpdateWorld()
       if window:MouseHit(2) then --play crawler attack animation
           self.mode = "attack"
       end
    
       if self.mode == "attack" then
           self.mode = "Waiting for animation to stop"
           self.entity:StopAnimation()
           self.entity:PlayAnimation("Attack2",0.009,10,1,"EndHit")
       elseif self.mode == "idle" then
           self.entity:PlayAnimation("Idle",0.02)
       end
    end
    
    function Script:EndHit()
       self.mode = "idle"
    end
    
    function Script:PostRender()
       context:SetBlendMode(Blend.Alpha)
       context:SetColor(1,1,1,1)
       context:DrawText("Mode: "..self.mode, 400, 200)
       context:SetBlendMode(Blend.Solid)
    end
    

  4. That is a very cool game man! I'm on my laptop so it's harder to play with the mouse pad so I stopped at the moving platform in level 2 but very cool concept there!

     

    Thanks. Yeah I always think of people with laptops but I don't think I could make it any easier in this case.

  5. Yep, my current project uses only 1 looped song because of this and it's 27MB (3.6MB OGG) for 2:39 minutes.

     

    Music in Little Dagon is 157MB but converted to OGG is 22.5MB.

     

    /me pokes Josh, twice, in the forehead

    • Upvote 1
  6. Copy the statue.fbx file to LeadWerks, then copy everything from the directory statue.fbm to the directory the statue.mdl is in. It will automatically add the textures to the material file. Also if you open the normals texture in the texture editor you have to select "Normal map." LeadWerks only imports it as a normal map if you have _dot3 in the filename, like "statue_bump_dot3.png." If your icons are still black after that just open them and click save.

     

    I hope Josh changes the import to search for a "model.fbm" directory for the material editor to pull the textures from.

    • Upvote 1
×
×
  • Create New...