Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

2D minecraft

edited September 2014 in Code Sharing Posts: 167

Not all the features are in here, spent 1-3 hour(s) working on this

Tagged:
«1

Comments

  • edited July 2014 Posts: 167
    --I finally do a good game
    
    -- 2D minecraft
    
    p = vec2(400)
    
    
    --Features:
    
    --[[
    
    Sun
    cloud
    steve
    grass blocks
    controls
    ]]--
    
    --Update thoughts:
    
    --[[ moving clouds
    tools
    finished body parts
    underworld
    day and night
    monsters
    smaller D-PAD
    hotbar
    invintory
    crafting GUI and crafting tables
    more blocks
    options menu(mostly parameters and output)
    better animations
    commands(can be toggled in the options menu)
    animals
    bigger worlds
    ]]--
    
    
    --Inspired by:
    
    --©Mojang™
    
    
    --This program built by:
    
    --©Apple Smell Games™
    
    
    --Credit:
    
    --©Mojang AB™
    
    
    --Full credit:
    
    --Markus Alexej Persson (thotherwise known as Notch)
    
    function setup()
    
      displayMode(FULLSCREEN)
    
        rsw = math.random(100, 300)
    
        rsh = math.random(50, 100)
    
        rsx = math.random(0, 700)
    
       
    end
    
    
    function draw()
    
        
        background(119, 119, 225, 255)
    
        
       
    
         --Cloud
    
    
            fill(255, 255, 255, 69)
    
        rect(400, 650, rsw, 50)
    
    
    --Grass bottom
    
    for i = 1,6 do 
    
        fill(118, 77, 30, 255)
    
        rect(100 * i, 0, 100, 100)
    
        end
    
        
        --Steve!
    
        --Head
    
        fill(180, 154, 80, 255)
    
        rect(p.x, 250, 70, 70)
    
        --Body
    
        fill(0, 0, 255, 255)
    
        rect(p.x, 105, 70, 150)
    
      --Steve has no arms, legs,eyes, or mouth right now because of bugs...
    
    
    if p.x >600 then
    
        p.x = 400
    
    end
    
    
    if p.x <100 then 
    
        p.x = 400
    
    end
    
    
    --Sun
    
    fill(243, 255, 0, 255)
    
    rect(600, 600, 300, 300)
    
        --Grass top
    
        fill(0, 255, 0, 255)
    
        rect(100, 100, 600, 30)
    
        
        --Controls (may be a little weird looking)
    
        sprite("Cargo Bot:Command Left", 10, 500, 50, 1000)
    
        sprite("Cargo Bot:Command Right", 1000, 500, 50, 1000)
    
    end
    
    
    function touched(t)
    
        if CurrentTouch.x > 949 then
    
            p.x = p.x + 3
    
        end
    
        if CurrentTouch.x < 15 then
    
            p.x = p.x - 3
    
        end
    
    end
    
  • IgnatzIgnatz Mod
    Posts: 5,396

    @code_maker - that's a good start.

    Making a game is hard work, though, and you shouldn't be surprised if it takes quite a few hours more to put the main features together and get them working! (I usually have to rewrite and rearrange my code a couple of times as well).

  • Posts: 577

    @code_maker Awesome! One thing I will warn you about though is this: don't draw all the blocks separately. Instead, use setContext() When ever you want to place a new one, that way it is just one huge image instead of tons of smaller ones.

  • Posts: 1,976

    @Prynok But, there is the max 4096x ("2048x" on retina) size limit for images... And in 2.0, there's the lag bug for 2D setContext()s.

  • edited July 2014 Posts: 223
    The user and all related content has been deleted.
  • Posts: 167

    Thanks for all the info and support guys! I'm updating it an adding better stuff! Even a better Steve skin. And right now I'm working on a day - night cycle. Right now I'm debbunging it. The bug is when the sun is at its limit and it will turn night but they are just CHANGING EVERY FRAME! They switch between day and night every frame on my iPad. Now it should be about 3-6 hours before the next realese, to see what is in there, Get my next version of this game (2D Minecraft 2.0), and check in feautures.

  • Posts: 167

    ~2.0 is here like 0.9 came here this morning on the App Store! :)~

    --# Main

    -- 2D minecraft

    p = vec2(400)

    sun = vec2()

    --Features:

    --[[
    Sun
    cloud
    steve
    grass blocks
    controls
    day night clycle, still a little bug though... could cause short seasures with people who have elepsy :(
    smaller D-PAD
    better Steve skin
    borders at the edge od the blocks(it sends you back to the middle)

    ]]--

    --Update thoughts:

    --[[ moving clouds

    tools
    underworld
    monsters
    hotbar
    invintory
    crafting GUI and crafting tables
    more blocks
    options menu(mostly parameters and output)
    better animations
    commands(can be toggled in the options menu)
    animals
    bigger worlds
    creative and survival mode

    ]]--

    --Muti player is impossible to add... :( sorry for the incovenience but, seariously, im doing this in Lua 5.1...

    --Inspired by:

    --©Mojang™

    --This program built by:

    --©Apple Smell Games™

    --Credit:

    --©Mojang AB™

    --Full credit:

    --Markus Alexej Persson (thotherwise known as Notch)

    function setup()

    displayMode(FULLSCREEN)

    rsw = math.random(100, 300)
    
    rsh = math.random(50, 100)
    
    rsx = math.random(0, 700)
    
    
    supportedOrientations(LANDSCAPE_ANY)
    

    --Open the ouput feild for now for the options menu

    --Im working on an in game options menu

    --Please play with caution as this game contatans a pattern that could cause seasures.

    end

    function draw()

    Play:draw()

    end

    function touched(t)

    if CurrentTouch.x > 949 and CurrentTouch.y >493 and CurrentTouch.y < 507 then
    
        p.x = p.x + 3
    
    end
    
    if CurrentTouch.x < 15 and CurrentTouch.y <507 and CurrentTouch.x >0 and CurrentTouch.y >494  then 
    
        p.x = p.x - 3
    
    end
    

    end

    --# Play

    Play = class()

    function Play:draw()

    if sun.y >= 750 then
    
    background(0, 0, 0, 255)
    
    sun.y = -10
    

    end

    if sun.y >=30 then

    background(119, 119, 225, 255)
    

    end

     --Cloud
    
    
        fill(255, 255, 255, 65)
    
    rect(400, 650, rsw, 50)
    

    --Grass bottom

    for i = 1,6 do

    fill(118, 77, 30, 255)
    
    rect(100 * i, 0, 100, 100)
    
    end
    
    --Steve!
    
    sprite("Documents:Steve", p.x, 170, 100, 110)
    
    --Head
    

    -- fill(180, 154, 80, 255)

    -- rect(p.x, 250, 70, 70)

    --Body
    

    -- fill(0, 0, 255, 255)

    if p.x >600 then

    p.x = 400
    

    end

    if p.x <100 then

    p.x = 400
    

    end

    --Sun

    fill(243, 255, 0, 255)

    rect(600, 0 + sun.y, 300, 300)

    sun.y = sun.y + 0.3

    --Grass top
    
    fill(0, 255, 0, 255)
    
    rect(100, 100, 600, 30)
    
    --Controls (improved a bit!)
    
    sprite("Cargo Bot:Command Left", 15, 500)
    
    sprite("Cargo Bot:Command Right", 1000, 500)
    

    end

    function Play:touched(touch)

    -- Codea does not automatically call this method
    

    end

  • Posts: 135

    Pretty good improvements, also format code like this

    Three '~' before and after your code on separate lines

  • edited July 2014 Posts: 223
    The user and all related content has been deleted.
  • Posts: 2,042

    @NatTheCoder, that'e exactly what Doge said.

  • The user and all related content has been deleted.
  • Posts: 1,976

    @NatTheCoder How can you say something efficiently?

  • IgnatzIgnatz Mod
    edited July 2014 Posts: 5,396

    @SkyTheCoder, @JakAttak, @NatTheCoder - this isn't important, let's get back to coding

  • Posts: 167

    Correct Ignatz, I'm going to get back to coding on 2D Minecraft 3.0, 3.0 might have some bugs so if you could point out the bugs to me I would appreciate that and try to fix them :)

  • edited July 2014 Posts: 167
    2.1 came for bug fixes, to see them, look at the bug fixes comment at Main
    
    
    --# Main
    
    -- 2D minecraft
    
    p = vec2(400)
    
    sun = vec2()
    
    
    --Features:
    
    --[[
    
    Sun
    
    cloud
    
    steve
    
    grass blocks
    
    controls
    
    day and night cycle(working fine now)
    
    smaller D-PAD
    
    better Steve skin
    
    borders at the edge of the blocks(it sends you back to the middle)
    
    ]]--
    
    --Update thoughts:
    
    --[[ moving clouds
    tools
    underworld
    monsters
    hotbar
    invintory
    crafting GUI and crafting tables
    more blocks
    options menu(mostly parameters and output)
    better animations
    commands(can be toggled in the options menu)
    animals
    bigger worlds
    creative and survival mode
    TNT
    fire
    flint and steel
    weather(when weather first comes out it will just have rain)
    ]]--
    
    
    --Never to add:
    
    --[[
    
    Muti player is impossible to add... :( sorry for the incovenience but, seariously, im doing this in Lua 5.1...
    
    3D UI INTERFACE
    ]]--
    
    --Bug fixes:
    
    --[[
    Fixed issuie when game first starts at night and it doesnt erase where you have been.
    
    Fixed issue that caused day and night to switch every frame.
    ]]--
    
    --Inspired by:
    
    --©Mojang™
    
    --This program built by:
    
    --©Apple Smell Games™
    
    --Credit:
    
    --©Mojang AB™
    
    --Full credit:
    
    --Markus Alexej Persson (thotherwise known as Notch)
    
    function setup()
    
    
      displayMode(FULLSCREEN)
    
        rsw = math.random(100, 300)
    
        rsh = math.random(50, 100)
    
        rsx = math.random(0, 700)
    
    
        supportedOrientations(LANDSCAPE_ANY)
    
    end
    
    
    function draw()
    
      Play:draw()
    
    end
    
    
    function touched(t)
    
        if CurrentTouch.x > 949 and CurrentTouch.y >493 and CurrentTouch.y < 507 then
    
            p.x = p.x + 3
    
        end
    
        if CurrentTouch.x < 15 and CurrentTouch.y <507 and CurrentTouch.x >0 and CurrentTouch.y >494  then 
    
            p.x = p.x - 3
    
        end
    
    end
    
    --# Play
    
    Play = class()
    
    function Play:draw()  
    
    
        background(0, 0, 0, 255)
    
    
    
        if sun.y >= 750 then
    
        background(0, 0, 0, 255)
    
        sun.y = -10
    
    end
    
    if sun.y >=30 then
    
        background(119, 119, 225, 255)
    
    end
    
         --Cloud
    
            fill(255, 255, 255, 65)
    
        rect(400, 650, rsw, 50)
    
    --Grass bottom
    
    for i = 1,6 do 
    
        fill(118, 77, 30, 255)
    
        rect(100 * i, 0, 100, 100)
    
        end
    
        --Steve!
    
        sprite("Documents:Steve", p.x, 170, 100, 110)
    
    if p.x >600 then
    
        p.x = 400
    
    end
    
    
    if p.x <100 then 
    
        p.x = 400
    
    end
    
    --Sun
    
    fill(243, 255, 0, 255)
    
    rect(600, 0 + sun.y, 300, 300)
    
    sun.y = sun.y + 0.3
    
        --Grass top
    
        fill(0, 255, 0, 255)
    
        rect(100, 100, 600, 30)
    
        --Controls (improved a bit!)
    
        sprite("Cargo Bot:Command Left", 15, 500)
    
        sprite("Cargo Bot:Command Right", 1000, 500)
    
    end
    
    function Play:touched(touch)
    
    end
    
    
  • Posts: 65

    I really don't want to sound mean, but these controls are terrible! Try to put everything in your touch function into your draw function. Just tap somewhere else then the buttons to stop moving.

  • Posts: 425

    For better controls use something like this

    function setup()
        rightButtonPressed=false
        leftButtonPressed=false
    end
    
    function draw()
        if rightButtonPressed==true then
            --move right
        end
        if leftButtonPressed==true then
            --move left
        end
    end
    
    function touched(touch)
        if touch.state==ENDED then
            rightButtonPressed=false
            leftButtonPressed=false
        else
            if checkIfTouchIsOnTheLeftButton then
                leftButtonPressed=true
            end
            if checkIfTouchIsOnTheRightButton then
                rightButtonPressed=true
            end
        end
    end
    
  • Posts: 65

    That's a better way to do it :)

  • Posts: 167

    Ok, I will add that for 3.0!

  • Posts: 167

    I tryed it but, i couldn't move the player... It could Maby be that I have an iPad 1 with Codea 1.5... And you guys have Codea 2.0, but... Since I'm the developer I have to test the game... So I will make it up to you guys by making the controls more simple...

  • Posts: 425

    The version of codea shouldn't make any difference.

  • Posts: 2,042

    @code_maker, did you change checkIfTouchIsOnTheLeftButton and checkIfTouchIsOnTheRightButton to actually checks? because if you left them like that they are worthless.

  • May I suggest you use Spritely for the images?

  • IgnatzIgnatz Mod
    Posts: 5,396

    @aurumcoder2624 - Spritely stores images very inefficiently, I wouldn't recommend using it here

  • Oh...

  • edited July 2014 Posts: 167
    3.0 is now available with better stuff!
    
    
    --# Main
    
    -- 2D minecraft
    
    p = vec2(400)
    
    sun = vec2()
    
    
    
    --Features:
    
    --[[
    Sun
    cloud
    steve
    grass blocks
    controls
    day and night cycle
    smaller D-PAD
    better Steve skin
    borders at the edge of the blocks(it sends you back to the middle)
    bigger worlds(still working on code for the camera to move with you :) )
    survival mode(im gonna think of creative mode for 0.3.1 or 0.4.0)
    lives
    sounds when you go off the edge
    deaths
    5% speed
    hotbar(still needs a little work though, this means tools or mining coming soon!)
    ]]--
    --Update thoughts:
    --[[ moving clouds
    tools
    underworld
    ather
    mining
    monsters
    invintory
    crafting GUI and crafting tables(working on the crafting GUI, crafting tables coming soon! possibly 4.0 through 5.1)
    more blocks
    options menu(mostly parameters and output)
    better animations
    commands(can be toggled in the options menu)
    animals
    TNT
    fire
    flint and steel
    weather(when weather first comes out it will just have rain)
    stars
    saving the data on your lives(im working on it! :)
    nameTags
    creative mode
    
    ]]--
    
    --Never to add:
    
    --[[
    
    Muti player is impossible to add... :( sorry for the incovenience but, seariously, im doing this in Lua 5.1...
    
    3D UI INTERFACE
    
    ]]--
    
    --Bug fixes:
    
    --[[ no fixed
    
    ]]--
    
    --Inspired by:
    
    --©Mojang™
    
    --This program built by:
    
    --©Apple Smell Games™
    
    --Credit:
    
    --©Mojang AB™
    
    --Full credit:
    
    --Markus Alexej Persson (thotherwise known as Notch)
    
    function setup()
    
    
      displayMode(FULLSCREEN)
    
    
        rsw = math.random(100, 300)
    
        rsh = math.random(50, 100)
    
        rsx = math.random(0, 700)
    
    
    
      version = "0.3.0 beta"
    
    lives = 10
    
        supportedOrientations(LANDSCAPE_ANY)
    
    end
    
    function draw()
    
    
        background(0, 0, 0, 255)
    
      Play:draw()
    
    --readProjectData("health")
    
    end
    
    function touched(t)
    
           if t.x >949 and t.x <1004 and t.y >494 and t.y <504 then
    
            p.x = p.x + 5
    
            end
    
            if t.x >0 and t.x <23 and t.y >494 and t.y <504 then
    
                p.x = p.x - 5
    
        end
    
    end
    
    --# Play
    
    Play = class()
    
    function Play:draw()  
    
        background(0, 0, 0, 255)
    
        if sun.y >= 750 then
    
        background(0, 0, 0, 255)
    
        sun.y = -100
    
    end
    
    if sun.y >=30 then
    
        background(119, 119, 225, 255)
    
    end
    
         --Cloud
    
            fill(255, 255, 255, 65)
    
        rect(400, 650, rsw, 50)
    
    
    --Grass bottom
    
    for i = 1,10 do 
    
        fill(118, 77, 30, 255)
    
        rect(100 * i, 0, 100, 100)
    
        end
    
        --Steve!
    
        sprite("Documents:Steve", p.x, 185, 100, 110)
    
        --Head
    
    --    fill(180, 154, 80, 255)
    
     --   rect(p.x, 250, 70, 70)
    
        --Body
    
    --    fill(0, 0, 255, 255)
    
    if p.x >1000 then
    
    p.x = 400
    
        --saveProjectData("health", 1)
    
        for i = 1,1 do
    
            sound(SOUND_HIT, 41660)
    
            lives = lives - 1
    
        end
    
    end
    
    if p.x <100 then 
    
        p.x = 400
    
        for i = 1,1 do
    
            sound(SOUND_HIT, 41660)
    
            lives = lives - 1
    
        end
    
    end
    
    --fill(127, 127, 127, 90)
    
    --rect(300, 300, 70, 70)
    
    --fill(255, 255, 255, 255)
    
    --text("Craft", 330, 330)
    
    --if CurrentTouch.x >294 and CurrentTouch.x <374 and CurrentTouch.y >294 and CurrentTouch.y <374 then
    
        --Craft:draw()
    
    --end
    
    --Inventory/hotbar
    
    fill(127, 127, 127, 107)
    
    rect(700, 600, 70, 70)
    
    rect(800, 600, 70, 70)
    
    for i = 1,lives do
    
        sprite("Planet Cute:Heart", 70 * i, 600, 50, 50)
    
    end
    
    --Sun
    
    fill(243, 255, 0, 255)
    
    rect(600, 0 + sun.y, 300, 300)
    
    sun.y = sun.y + 0.3
    
        --Grass top
    
        fill(0, 255, 0, 255)
    
        rect(100, 100, 1000, 30)
    
            --Controls
    
        sprite("Cargo Bot:Command Left", 15, 500)
    
        sprite("Cargo Bot:Command Right", 1000, 500)
    
        if lives == 0 then
    
            restart()
    
            --clearProjectData()
    
        end
    
    end
    
    function Play:touched(touch)
    
        -- Codea does not automatically call this method
    
    end
    
    --# Craft
    
    Craft = class()
    
    function Craft:draw()
    
        background(123, 104, 30, 255)
    
        fill(255, 255, 255, 255)
    
        text("Crafting not avable yet... \n try again in 0.3.1 or 0.4.0 :(", 300, 400)
    
    end
    
    function Craft:touched(touch)
    
        -- Codea does not automatically call this method
    
    end
    
  • Posts: 167

    Let me know if any of you guys have found bugs in 0.3.0.... I'm almost finished with 3.1

  • edited July 2014 Posts: 167

    --# Main
    --3.1
    -- 2D minecraft

    p = vec2(400)

    sun = vec2()

    m = vec2(0)

    --Features:

    --[[
    Sun
    cloud
    steve
    grass blocks
    controls
    day and night cycle
    smaller D-PAD
    better Steve skin
    borders at the edge of the blocks(it sends you back to the middle)
    bigger worlds(still working on code for the camera to move with you :) )
    survival mode
    lives
    sounds when you go off the edge
    deaths
    5% speed
    hotbar(still needs a little work though, this means tools or mining coming soon!)
    NameTags
    pause menu(A little work still on it to pause.)
    name tag color
    sprinting
    tint packs(tints everything 1 color)
    apple(the red circle and it restores your lives back to 10 and in a later update when you touch it and eat it, it will be removed)
    ]]--

    --Experamrntal:

    --[[
    Crafting and Crafting GUI
    ]]--

    --Update thoughts:

    --[[ moving clouds
    tools
    ather
    mining
    monsters
    invintory
    crafting GUI and crafting tables(working on the crafting GUI, crafting tables coming soon! possibly 4.0 through 5.1)
    more blocks
    better animations
    commands(can be toggled in the options menu)
    animals
    TNT
    fire
    flint and steel
    weather(when weather first comes out it will just have rain)
    stars
    saving the data on your lives(im working on it! :)
    creative mod
    sneaking
    moon
    neather(most simple because a big neather can cause heavy lag on low memory devices and single core prossecors too)
    more foods
    ]]--

    --Never to add:

    --[[

    Muti player is impossible to add... :( sorry for the incovenience but, seariously, im doing this in Lua 5.1...

    3D UI INTERFACE
    ]]--

    --Bug fixes:

    --[[ no fixed
    ]]--

    --Inspired by:

    --©Mojang™

    --This program built by:

    --©Apple Smell Games™

    --Credit:

    --©Mojang AB™

    --Full credit:

    --Markus Alexej Persson (thotherwise known as Notch)

    function setup()

        
      displayMode(FULLSCREEN)

    parameter.text("Username", "Steve")

    parameter.color("NameTagColor", 255)

    parameter.integer("GameMode", 0, 1, 0)

    parameter.boolean("BlueTintPack", false)

        rsw = math.random(100, 300)

        rsh = math.random(50, 100)

        rsx = math.random(0, 700)

        appleSpawn = 0

        dirt = {}

        grass = {}

        table.insert(dirt, 1)
       
      version = "0.3.1 beta"

    lives = 10

        supportedOrientations(LANDSCAPE_ANY)
      
    end

    function draw()
        
        background(0, 0, 0, 255)
     
      Play:draw()

    end

    function touched(t)

           if t.x >949 and t.x <1004 and t.y >494 and t.y <504 then

            p.x = p.x + 5

            end

            if t.x >0 and t.x <23 and t.y >494 and t.y <504 then

                p.x = p.x - 5

        end

        if t.x >0 and t.x <23 and t.y >294 and t.y <304 then

            p.x = p.x - 10

        end

        if t.x >949 and t.x <1004 and t.y >294 and t.y <304 then

            p.x = p.x + 10

        end

        if p.x >=599 and p.x <=607 then

            lives = 10

        end

    end

    --# Play

    Play = class()

    function Play:draw()  
      
        background(0, 0, 0, 255)
      
        if BlueTintPack == true then

            tint(0, 16, 255, 255)

        else

            tint(255, 255, 255, 255)

        end

        if sun.y >= 750 then

        background(0, 0, 0, 255)

        sun.y = -200

    end

    if sun.y >=30 then

        background(119, 119, 225, 255)

    end

         --Cloud

            fill(255, 255, 255, 65)

        rect(400, 650, rsw, 50)

    --Grass bottom

    if BlueTintPack == true then

        fill(58, 82, 176, 255)

    else

        fill(116, 73, 31, 255)

    end

    for i = 1,10 do 

        rect(100 * i, 0, 100, 100)

        end

    --Username tag

    fill(NameTagColor)

    text("" ..Username, p.x , 255)

        --Steve!

        sprite("Documents:Steve", p.x, 185, 100, 110)

        --Head

     -- fill(180, 154, 80, 255)

        --rect(p.x, 250, 70, 70)

        --Body

    --    fill(0, 0, 255, 255)

    if p.x >1000 then

    p.x = 400
        
        for i = 1,1 do

            sound(SOUND_HIT, 41660)

            lives = lives - 1

        end

    end

    if p.x <100 then 

        p.x = 400
      
        for i = 1,1 do

            sound(SOUND_HIT, 41660)

            lives = lives - 1

        end

    end

    --fill(127, 127, 127, 90)

    --rect(300, 300, 70, 70)

    --fill(255, 255, 255, 255)

    --text("Craft", 330, 330)

    --if CurrentTouch.x >294 and CurrentTouch.x <374 and CurrentTouch.y >294 and CurrentTouch.y <374 then

       -- Craft:draw()

    --end

    --Inventory/hotbar

    fill(127, 127, 127, 107)

    rect(700, 600, 70, 70)

    rect(800, 600, 70, 70)

    for i = 1,lives do

        sprite("Planet Cute:Heart", 70 * i, 600, 50, 50)

    end

    --Sun

    fill(243, 255, 0, 255)

    rect(600, 0 + sun.y, 300, 300)

    sun.y = sun.y + 0.3

    appleSpawn = appleSpawn + 1

    if appleSpawn >=500 then

        fill(255, 0, 0, 255)

        ellipse(600, 150, 40)

    end

        --Grass top

        if BlueTintPack == true then

            fill(0, 76, 255, 255)

        else

        fill(0, 255, 0, 255)

    end

        rect(100, 100, 1000, 30)
        
        --Controls

        sprite("Cargo Bot:Command Left", 15, 500)

        sprite("Cargo Bot:Command Right", 1000, 500)

        tint(196, 30, 30, 255)

        sprite("Cargo Bot:Command Left", 15, 300)

        sprite("Cargo Bot:Command Right", 1000, 300)

        if lives == 0 then

            restart()

        end

        fill(127, 127, 127, 113)

    rect(830, 730, 50, 50)

    fill(255, 255, 255, 255)

    text("||", 850, 750)

    if CurrentTouch.x >=824 and CurrentTouch.x <=874 and CurrentTouch.y >=724 and CurrentTouch.y <=784 then

        background(127, 127, 127, 0)

        fill(198, 193, 193, 255)

        text("Paused", 400, 600)

        fill(255, 255, 255, 255)

    text("Touch to resume", 500, 500)

        end

    end

    function Play:touched(touch)
      
    end

    --# Craft

    Craft = class()

    function Craft:draw()

        background(123, 104, 30, 255)

        fill(87, 255, 0, 255)

        rect(400, 500, 100, 100)

        fill(255, 255, 255, 255)

       text("Grass", 400, 470)

    fill(127, 127, 127, 128)

    rect(600, 600, 70, 70)

    fill(255, 255, 255, 255)

    text("CRAFT", 630, 630)

    end

    function Craft:touched(touch)

    if touch.x >594 and touch.x <674 and touch.y >594 and touch.y <674 then

        craft()

        end

    end

    function craft()

        table.insert(grass, 1)

        table.remove(dirt)

        displayMode(STANDARD)

        print("Crafted!")

    end

  • IgnatzIgnatz Mod
    Posts: 5,396

    @code_maker

    When you post code, it is totally unreadable. Please put three ~~~ on a line before, and after, the code, to format it properly. (Don't put code on the same line as ~).

    As your program is getting long, I suggest you set up a Gist account (gist.github.com) where you can store your code, then post the link on the forum here. People can then copy your code from the gist.

  • Posts: 167

    Ok thanks ignatz! I'm also gonna get a gist account for the 0.4 release, I'm adding a start to crafting and I'm adding building along with a neather! (already got the crafting and building done, now for the neather) but, you can't mannualy build yet... There is a button for building right now... It's already like 300 somthing lines long...

  • Posts: 167

    @Ignatz Gisthub got me cunfused badly so I tryed pastebin and I said I would need to pay for accualy use, but, I found another website for 4.0... It's codepad

  • edited July 2014 Posts: 167

    ~~~4.0 code is too long so, here is a link for it:

    http://codepad.org/tly5pKwy

    ~~~

  • edited July 2014 Posts: 167

    Sorry guys, didnt realize that you can't come back from the neather... I'm working on 4.1 and I'm adding a new block called the 'NeatherBack', it's a way to get back from the neather... =D

  • Posts: 167

    4.1 came out for fixes:
    Can't exit the building menu after you craft the neather portal(I just pasted the code under the statement: 'if obsidian ==3 then' so, I fixed that, I also added the neatherBack(a way to get back from the neather, it's the blinking thing in the neather behind the sun's X quardnets) and I added a little bounus feature, a red circle as a cursor

    http://codepad.org/s3IMWGgS
    
  • Posts: 167

    I'm gonna add all the features in the section update thoughts before the 1.0 release. So that's why I'm doing stuff like 0.3.1 not for fixes but new features, so, expect 0.4.2! Also, why every update is coming every few hours is because Im slowly adding features... Now to start my work on 0.4.2, I will try for WEATHER!!!! :)

  • Hola Mola! Ores and picks(or at least I've done the variables). I hope I can speed up the release. I am doing coal,iron,gold,diamond,emeral,and redstone ores. They value nothing though until I add sticks, mineble trees, and underground. At least you can mine the ores! :) But, I can think of a starting UI for an option to play creative/survival. If I do add creative, you can only fly... But, at least it is a start.

  • Oh yhea, I also finished player levels. The best part is that is saves your level.

  • I'm getting lost in new features too easily. I took most of my attention off of the picks and ores to develop a start screen, creative mode,survival mode,and flying in creative mode. And I also made a new pause menu. The new pause is still a WIP(work in progress). You can only resume the game, and if you enter that screen more than once, it will flip and you can't click back to the normal screen. Time to work on the picks and ores again! The new version 0.5.0 should be here in about 2 days! Veiw this every day! ;)

  • It's here, the update. New features: iron ore(more ores coming soon!) pickaxes, iron ingots(have no use at the moment, 0.6.0 will give them 1 use...) a starting screen, creative mode(no infininte block yet..) survival mode, flying in creative mode. Mining ores(ores only.., I will try for mining the ground in 0.6)and last, a new pause menu for survival(a but buggy, back to title won't work... :/ ). HOPE YOU WILL ENJOY PLAYING THIS AWSOME UPDATE!

    Link to code:
    http://codepad.org/OpRATFtc

  • Ok

  • I agree with @skullagepk. This game has its issues, many of them. THAT SAID, don't be disheartened by our opinions; and, more importantly, don't give up if this is what you truly enjoy (or even if you enjoy it just a little bit) :) rather, I hope you use our criticism constructively to better both this project and yourself as a programmer. So, if you ever need any help, have any questions, I'm not the best but I'd love to help you out. And we have a whole community full of people who I'm sure would love to help you as well--if you're willing to be helped. So first off: structure. Structure is VERY important to programming. There are two types of structure; Progressive and Object Oriented. Your current code uses a more progressive approach, where each frame it just runs through a list of commands and makes a [somewhat] comprehensive program. Progressive structure is both archaic and horrendously inefficient. You need to strive for an object oriented (class and function-based) structure, as this is the norm for programming nowadays (it is also the most fluent and efficient way to code). For instance: instead of having a bajillion if/then statements deciding where touches are going for buttons, make a dedicated button Class, or take one from the forums. For the player, make a player class that you can move. Instead of the world being hectically drawn and hard-coded in, make a world draw class that stores the world map in a table then draws it with for/do statements. With classes, your code is much cleaner, much easier to read, and most importantly, MUCH easier to maintain, edit, cut, copy, and CONTROL. your game's updates take forever, but they don't really add much. This is because you are taking the progressive approach and hard-coding everything. If you'd like the help, if you'd like to learn about classes and how powerful and helpful they can be, please ask me and I would LOVE to help you learn these things. As I said, I'm not the best, but as one who was once where you are, I want to help you out of that same rut. The end.

  • Okay, I will stop posting the updates. Well, your lost, I'm adding robots built with redstone and finishing the ores in the next update.

  • Eh, I'm kinda a one man coder in this project, I don't need any help...

  • Nice

  • I'm happy to help

  • Thx

  • I added differint hearts the other ones looked weird I will remake the inventory

  • SWEET! Your the best! When your ready, can you post the update? It sounds really new looking.

  • Ok I'm also adding new inventory

  • Do you have a twitter

Sign In or Register to comment.