These are the movement method I use in Stageoids
To activate the move command, put this function into the update function in main.rb file.
if button_down? Gosu::Button::KbLeft
@player.move_left
end
This calls the move_left function in the player.rb file. This is...
def move_left
//Move left at the speed the move_speed value
@x = @x - @move_speed
//Make it so we can't leave the screen
if @x < 0
@x = 0
end
end
For this to work, you need to define these variables in the player.rb file's initialize function.
@x = 0
@y = 0
@move_speed = 10
This will start you in the bottom left corner.
For the other directions duplicate the functions and replace the values as follows...
::Right::
KbLeft -> KbRight
move_left -> move_right
@x - @move_speed -> @x + @move_speed
@x < 0 -> @x > 0
::Up::
KbLeft -> KbUp
move_left -> move_up
@x - @move_speed -> @y + @move_speed
@x < 0 -> @y > 0
::Down::
KbLeft -> KbDown
move_left -> move_down
@x - @move_speed -> @y - @move_speed
@x < 0 -> @y < 0
To create the player to move around in your game, use @player = Player.new(self) in the initialize function in main.rb
For collisions with walls, I suggest you have a look the Cptn. Ruby tutorial.
As for the scrolling, unfortunately, I have no idea.
When you have a working prototype, create a post in the showcase forum with the file attached so people can download it and help you work errors and bugs out.