Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

NamKazt's Flatform Move Systems : New Version 1.4.4

i just update a feature :

* block if event not through
- it have a problem is distance too long but i think i will edit some think but not here to fix it.

def passable in Game_Character Class
Code:
def passable?(mode = 0)

    left_x = @real_x + 32 >> 7    # 4 << 3

    right_x = @real_x + 110 >> 7  # 28 << 3

    up_y = @real_y + 16>> 7      # 2 << 3

    down_y = @real_y + 110 >> 7   # 28 << 3

    # Get new coordinates

    if mode == 0

      if @xv > 0

        return false unless $game_map.passable?(right_x, up_y,6)

        return false unless $game_map.passable?(right_x, down_y,6)

      else

        return false unless $game_map.passable?(left_x, up_y,4)

        return false unless $game_map.passable?(left_x, down_y,4)

      end

    else

      if @yv > 0

        return false unless $game_map.passable?(left_x, down_y,2)

        return false unless $game_map.passable?(right_x, down_y,2)

      else

        return false unless $game_map.passable?(left_x, up_y,8)

        return false unless $game_map.passable?(right_x, up_y,8)

      end

    end

    

    if @through 

      return true

    end

    # Loop all events

    for event in $game_map.events.values

       new_x = (event.direction == 6 ? ((@real_x + 32 >> 7) + 1) :  event.direction == 4 ? ((@real_x + 110 >> 7) + 1) : 0)

       new_y = (event.direction == 2 ? ((@real_y + 16 >> 7) + 1) :  event.direction == 8 ? ((@real_y + 110 >> 7) + 1) : 0)

      # If event coordinates are consistent with move destination

      if event.x == new_x and event.y == new_y 

        #If through is OFF

        unless event.through

          # If self is event

          if self != $game_player

            # impassable

            return false

          end

          # With self as the player and partner graphic as character

          if event.character_name != ""

            # impassable

            return false

          end

        end

      end

    end

    

    new1_x = ($game_player.direction == 6 ? ((@real_x + 32 >> 7) +  1) : $game_player.direction == 4 ? ((@real_x + 110 >> 7) + 1) : 0)

    new1_y = ($game_player.direction == 2 ? ((@real_y + 16 >> 7) +  1) : $game_player.direction == 8 ? ((@real_y + 110 >> 7) + 1) : 0)

    #if is player

    if(self == $game_player)

    #Loop all events

    for event in $game_map.events.values

      if $game_player.x < event.x

          if(event.x - $game_player.x) < 2

            unless event.through 

              return false

            end

          end

      end

      

      if $game_player.x > event.x

          if($game_player.x - event.x) < 2

            unless event.through 

              return false

            end

          end

      end

      

    end

    end

    

    if $game_player.x == new1_x and $game_player.y == new1_y

      # If through is OFF

      unless $game_player.through

        # If your own graphic is the character

        if @character_name != ""

          # impassable

          return false

        end

      end

    end

    

    

    return true

  end


change in :
Code:
#if is player

    if(self == $game_player)

    #Loop all events

    for event in $game_map.events.values

     #case 1 : position of player small than event

      if $game_player.x < event.x 

          if(event.x - $game_player.x) < 2

            unless event.through # if through

              return false

            end

          end

      end

      #case 1 : position of player lager than event

      if $game_player.x > event.x

          if($game_player.x - event.x) < 2

            unless event.through # if through

              return false

            end

          end

      end

      

    end

    end
 
Jeea":j2pjv6df said:
just make an event for jumping..

I made one ..

Awesome script, Anyway.. I'd recommend it to the others..
but I have a problem,

when I set an event to event touch or player touch, and tested it,
the event won't trigger!!
Please help!..

in the ladder, I tried using jump and putting a block for going down..
(now it acts like stairs..)

anyway,
for those who are kinda tired of pasting it to one rmxp project just to test it,
here it is!

It's not just pasted, or something, it would seem like a minigame..
Code:
[url=http://www.mediafire.com/file/9lz7zwl1frbga40/Platform%20Move%20System%20Demo.exe]http://www.mediafire.com/file/9lz7zwl1f ... 20Demo.exe[/url]
It inlcudes the jumping system I just made..

the instruction is inside the game..
Edit:I also made the jump higher..
Please, Enjoy..


i'll see your problems ^^~
and it included jump system :D u just press up button
 
This is excellent, just what I was looking for. One small thing, could you add support for slopes (as in, a 45 degree slope marked by an event with a comment in it)?
 
Naridar":26lrw35z said:
This is excellent, just what I was looking for. One small thing, could you add support for slopes (as in, a 45 degree slope marked by an event with a comment in it)?

i'll try
add it to todolist
 
Great platform system. I love the mechanics. It still needs tons of work, though. To start with, I think when on top of a moving event, the player should move with the event. Hope to see it finished someday.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top