Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Zefk

#1
Game art & music / Re: Project Heroine Sprites
November 15, 2020, 02:27:54 AM
Update:

The swimming animations are done. That sure was an abundance of swim swim swim.

Now I am gonna work on the sword stuff and a lot of that will just be copy, paste, and adjust until the sword spin.

I will post them on gitlab after the spin attack, then probably do a few more animations for all 40 plus Eldrina for 41 heroines.
#3
Game art & music / Re: Project Heroine Sprites
October 31, 2020, 02:13:35 AM
Update:

Completed the "falling" animation that I overlooked, now back to swim swim swim +40 times!
#4
Game art & music / Re: Project Heroine Sprites
October 26, 2020, 04:06:12 AM
Update:

Jumping is complete, now it is time to swim swim swim +40 times!
#5
Development / Re: Side scrolling functionality
August 11, 2018, 02:13:31 AM
I updated my post and made the side-scroling script somewhat stable: here

It is not perfect, but I could make a side-scroller game with it. I hope it helps someone out there.

Remember to credit Wrightmat because it is his script. I just patched it up.

P.S. I will just silently update the post above if I find bugs.
#6
Development / Re: [Solved]Hero state question
August 10, 2018, 12:32:09 AM
Ah, got it and that did fix my problem. It was quite odd because the hero would get stuck on the bow state if I pressed "b" and "down" very quickly on a ladder. Not sure if that is a bug. It could just be me.

Code ( lua) Select
         
          --State is a variable in hero:set_animation()
          --hero:set_animation(state)
          if key == "b" then
            hero:start_bow()
          elseif key == "down" and state == "walking" or state == "ladder" then
            hero:unfreeze()
          end
#7
Development / [Solved]Hero state question
August 09, 2018, 11:47:50 PM
I was wondering if there was a way to set the hero's state? All I noticed in the documentation was hero:get_state().

Sometimes the hero gets stuck on a certain state in my scripts and something like the following would be useful.

Code ( lua) Select
hero:set_state("free")
#8
Development / Re: Side scrolling functionality
August 09, 2018, 01:14:13 AM
@Christopho
Ah, I had no idea.

Updated:

  • Added facing direction option when jumping
  • Added a fix for when the hero gets stuck on a ladder when using the bow
  • Added fixes for sword
  • Added fixes for tapping
  • Added fixes for running
  • Added fixes for lifting
  • Added fixes for water - needs to be converted to dynamic and named water
  • Added fixes for block
  • Added fixes for carrying destructible entities
  • Added fixes for boomerang
  • Added fixes for hookshot
  • Added fixes for opening chest
  • Added fixes for hole or falling
  • Added fake death
  • Added script and comment clean up
  • Added fixes for holding multiple keys when carrying

Download Quest: here

The thing I cannot figure out. The hero jumps faster and faster after every death. The only thing I can think of is to use a fake game:start().

Code ( lua) Select
        local map = game:get_map()
        --Fake death
        --map1
        if game:get_value("map1") == true and map:get_id() == "first_map" then
          if game:get_life() == 1 then
            hero:teleport("first_map", "map1", "fade")
            game:set_life(game:get_max_life())
          end
         --map2
         elseif game:get_value("map2") == true and map:get_id() == "map_leave_test" then
          if game:get_life() == 1 then
            hero:teleport("map_leave_test", "map2", "fade")
            game:set_life(game:get_max_life())
          end
        end

#9
Development / Re: Side scrolling functionality
August 08, 2018, 08:14:53 AM
Here is a little patch until wrightmat fixes the problem. The hero will not float and get stuck on the jumping animation. Although, it will not prevent the hero from standing still and moving when the right/down or left/down is being pressed at the same time.

Wrightmat's sidescroller script: here
Wrightmat's monster script: here

I think I heard a key on_pressing function was being made. Maybe that could fix the problem.

Patch for game:on_started():
Code ( lua) Select
  function game:on_started()
   local hero = game:get_hero()
    hero:set_tunic_sprite_id("main_heroes/eldran")
    sol.timer.start(gravity, function()
      if self:get_map() ~= nil then
        -- Gravity: move entities down one pixel on every update if there's no collision.
        --   (like with the ground or a platform) and hero not jumping or on a ladder.
        local hero = self:get_hero()
        local x, y, l = hero:get_position()
        if state ~= "jumping" and self:get_map():get_ground(hero:get_position()) ~= "ladder" then
          if not hero:test_obstacles(0, 1) then hero:set_position(x, (y + 1), l) end
        elseif state == "jumping" then
          for i = 1, jump_height do
            if not hero:test_obstacles(0, -1) then hero:set_position(x, (y - 1), l) end
          end
          sol.timer.start(gravity * jump_height, function()
            if self:is_command_pressed("right") or self:is_command_pressed("left") then
              state = "walking"
            else
              state = "stopped"
            end
            --right
            if self:is_command_pressed("right") and self:is_command_pressed("left") then
              hero:set_animation("walking")
              state = "walking"
            else
              state = "stopped"
            end
            if self:is_command_pressed("right") and self:is_command_pressed("up") then
              hero:set_animation("walking")
              state = "walking"
            else
              state = "stopped"
            end
            --left
            if self:is_command_pressed("left") and self:is_command_pressed("right") then
              hero:set_animation("walking")
              state = "walking"
            else
              state = "stopped"
            end
            if self:is_command_pressed("left") and self:is_command_pressed("up") then
              hero:set_animation("walking")
              state = "walking"
            else
              state = "stopped"
            end
            --up
            if self:is_command_pressed("up") and self:is_command_pressed("right") then
              hero:set_animation("walking")
              state = "walking"
            else
              state = "stopped"
            end
            if self:is_command_pressed("up") and self:is_command_pressed("left") then
              hero:set_animation("walking")
              state = "walking"
            else
              state = "stopped"
            end
            if self:is_command_pressed("up") and self:is_command_pressed("down") then
              hero:set_animation("walking")
              state = "walking"
            else
              state = "stopped"
            end
          end)
          hero:set_animation(state)
        end

  function game:on_key_pressed(key)
    local hero = game:get_hero()

    if key == "up" and key == "down" and key == "left" and key == "right"  then
      hero:set_animation("walking")
    else
      hero:set_animation("walking")
    end
  end


Explanation:

I added some checks function game:on_started() to prevent the hero from floating around.

Code ( lua) Select
            --right
            if self:is_command_pressed("right") and self:is_command_pressed("left") then
              hero:set_animation("walking")
              state = "walking"
            else
              state = "stopped"
            end
            if self:is_command_pressed("right") and self:is_command_pressed("up") then
              hero:set_animation("walking")
              state = "walking"
            else
              state = "stopped"
            end
            --left
            if self:is_command_pressed("left") and self:is_command_pressed("right") then
              hero:set_animation("walking")
              state = "walking"
            else
              state = "stopped"
            end
            if self:is_command_pressed("left") and self:is_command_pressed("up") then
              hero:set_animation("walking")
              state = "walking"
            else
              state = "stopped"
            end
            --up
            if self:is_command_pressed("up") and self:is_command_pressed("right") then
              hero:set_animation("walking")
              state = "walking"
            else
              state = "stopped"
            end
            if self:is_command_pressed("up") and self:is_command_pressed("left") then
              hero:set_animation("walking")
              state = "walking"
            else
              state = "stopped"
            end
            if self:is_command_pressed("up") and self:is_command_pressed("down") then
              hero:set_animation("walking")
              state = "walking"
            else
              state = "stopped"
            end


I added this function to prevent the hero from being stuck on the jumping animation.

Code ( lua) Select
  function game:on_key_pressed(key)
    local hero = game:get_hero()

    if key == "up" and key == "down" and key == "left" and key == "right"  then
      hero:set_animation("walking")
    else
      hero:set_animation("walking")
    end
  end
#10
Development / Re: Side scrolling functionality
August 08, 2018, 02:40:59 AM
I found a bug when holding down keys.  The hero glides around if I continue to hold the up and right keys at the same time and the hero retains the jump animation if I were to jump while holding the keys.
#11
@froggy77
Added it. Those are some nice tutorials.
#12
Development / Re: New Debian/Ubuntu Package Location
August 07, 2018, 07:32:45 AM
@Nate-Devv

I have to say thanks for the Ubuntu version! I use it all the time.
#13
Your projects / Re: Book Alpha Release
August 03, 2018, 07:55:29 AM
Okay, this is still experimental, but here it is the book!

You can find everything in Github release. The pdf is in the "book" directory.

Github Alpha Release: Here
Website: Here

Please report any errors/suggestions here or on Github and see new commits for fixes
#14
@Diarandor
Ah, I get it now. Thanks for clarifying Diarandor.

Since this is no way a bug. I will mark it as solved.
#15
@Max
I think enemy:on_dead() is a better solution, but I still find it odd.