mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-15 07:32:35 +00:00
Tweaked player drag, speed, and turn speed
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
cyberarm_engine (0.10.0)
|
||||
gosu (~> 0.14.0)
|
||||
gosu (0.14.5)
|
||||
gosu (0.14.5-x86-mingw32)
|
||||
opengl-bindings (1.6.7)
|
||||
opengl-bindings (1.6.9)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
x86-mingw32
|
||||
|
||||
DEPENDENCIES
|
||||
gosu
|
||||
cyberarm_engine
|
||||
opengl-bindings
|
||||
|
||||
BUNDLED WITH
|
||||
|
||||
@@ -12,9 +12,11 @@ class IMICFPS
|
||||
|
||||
@speed = 2.5 # meter's per second
|
||||
@running_speed = 6.8 # meter's per second
|
||||
@turn_speed = 50.0
|
||||
@old_speed = @speed
|
||||
@mass = 72 # kg
|
||||
@first_person_view = true
|
||||
@drag = 0.6
|
||||
|
||||
@devisor = 500.0
|
||||
@name_image = Gosu::Image.from_text("#{Etc.getlogin}", 100, font: "Consolas", align: :center)
|
||||
@@ -89,9 +91,9 @@ class IMICFPS
|
||||
def update
|
||||
relative_speed = @speed
|
||||
if InputMapper.down?(:sprint)
|
||||
relative_speed = (@running_speed) * (delta_time)
|
||||
relative_speed = @running_speed
|
||||
else
|
||||
relative_speed = @speed * (delta_time)
|
||||
relative_speed = @speed
|
||||
end
|
||||
|
||||
relative_y_rotation = @rotation.y * -1
|
||||
@@ -114,10 +116,10 @@ class IMICFPS
|
||||
end
|
||||
|
||||
if InputMapper.down?(:turn_left)
|
||||
@rotation.y += (relative_speed * 1000) * delta_time
|
||||
@rotation.y += @turn_speed * delta_time
|
||||
end
|
||||
if InputMapper.down?(:turn_right)
|
||||
@rotation.y -= (relative_speed * 1000) * delta_time
|
||||
@rotation.y -= @turn_speed * delta_time
|
||||
end
|
||||
|
||||
if @_time_in_air
|
||||
@@ -141,7 +143,7 @@ class IMICFPS
|
||||
|
||||
if @jumping && !@falling
|
||||
if InputMapper.down?(:jump)
|
||||
@velocity.y += 1.5
|
||||
@velocity.y = 1.5
|
||||
@falling = true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -20,7 +20,7 @@ class IMICFPS
|
||||
@renderable = true
|
||||
@rotation = Vector.new(0, 0, 0)
|
||||
@velocity = Vector.new(0, 0, 0)
|
||||
@drag = 0.94
|
||||
@drag = 1.0
|
||||
|
||||
@debug_color = Color.new(0.0, 1.0, 0.0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user