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