Browse Source

Merge branch 'master' into objective

master
Luna 7 years ago
parent
commit
8dcbe72f0c
8 changed files with 100 additions and 34 deletions
  1. +1
    -0
      README.md
  2. BIN
      assets/DejaVuSansMono.ttf
  3. +12
    -0
      bootstrap.py
  4. +9
    -0
      plans.md
  5. +2
    -0
      scenes/player.tscn
  6. +43
    -9
      scenes/world.tscn
  7. +18
    -11
      scripts/heroes/0.gd
  8. +15
    -14
      scripts/player.gd

+ 1
- 0
README.md View File

@ -19,6 +19,7 @@ Ideas for characters:
- More active - More active
- Blink (Tracer) - no cooldown, but loses all speed on hitting walls - Blink (Tracer) - no cooldown, but loses all speed on hitting walls
- Heavy guy - Slow, but very heavy for the see-saw - Heavy guy - Slow, but very heavy for the see-saw
- Flying, of course
- More supportive - More supportive
- Merge - combines with someone to boost their speed - Merge - combines with someone to boost their speed
- Boost - Area of effect or zarya-like cast, speeds people up - Boost - Area of effect or zarya-like cast, speeds people up


BIN
assets/DejaVuSansMono.ttf View File


+ 12
- 0
bootstrap.py View File

@ -0,0 +1,12 @@
#!/usr/bin/env python
import os
if os.path.exists("project.godot"):
# Update
os.system("git pull")
os.system("godot")
else:
# Initial download
os.system("git clone --depth 1 https://github.com/CosineGaming/nv-moba .")
os.system("godot")

+ 9
- 0
plans.md View File

@ -0,0 +1,9 @@
Big ideas:
Smaller TODOs:
- Make see-saw not as buggy
- Do we need to return players to being rigidbodies? we probably do for that see-saw but i don't wanna :(
When you have a workable demo: @mention @turion@mastodon.art

+ 2
- 0
scenes/player.tscn View File

@ -97,6 +97,8 @@ mouse_filter = 2
mouse_default_cursor_shape = 0 mouse_default_cursor_shape = 0
size_flags_horizontal = 1 size_flags_horizontal = 1
size_flags_vertical = 4 size_flags_vertical = 4
text = "+"
align = 1
percent_visible = 1.0 percent_visible = 1.0
lines_skipped = 0 lines_skipped = 0
max_lines_visible = -1 max_lines_visible = -1


+ 43
- 9
scenes/world.tscn
File diff suppressed because it is too large
View File


+ 18
- 11
scripts/heroes/0.gd View File

@ -1,7 +1,13 @@
extends "res://scripts/player.gd" extends "res://scripts/player.gd"
const wallride_speed = 0.5
const wallride_speed = 0
const wallride_speed_necessary = 15 const wallride_speed_necessary = 15
const wallride_leap_height = 10
const wallride_leap_side = 10
var since_on_wall = 0
var last_wall_normal = Vector3()
var wallride_forgiveness = .150
func control_player(delta): func control_player(delta):
wallride(delta) wallride(delta)
@ -9,15 +15,16 @@ func control_player(delta):
func wallride(delta): func wallride(delta):
# If our feet aren't touching, but we are colliding, we are wall-riding # If our feet aren't touching, but we are colliding, we are wall-riding
if is_on_wall() and velocity.length() > wallride_speed_necessary:
if is_on_wall() and not is_on_floor() and velocity.length() > wallride_speed_necessary:
since_on_wall = 0
last_wall_normal = get_slide_collision(0).normal
else:
since_on_wall += delta
if since_on_wall < wallride_forgiveness:
var aim = get_node("Yaw").get_global_transform().basis var aim = get_node("Yaw").get_global_transform().basis
var direction = Vector3()
if Input.is_action_pressed("move_forwards"):
direction -= aim[2]
if Input.is_action_pressed("move_backwards"):
direction += aim[2]
velocity += direction * wallride_speed
# Add zero gravity
velocity.y = -gravity # So it's undone in super velocity.y = -gravity # So it's undone in super
else:
pass
# We need to return to falling (we aren't riding anymore)
# Allow jumping (for wall hopping!)
if Input.is_action_just_pressed("jump"):
velocity.y += wallride_leap_height
velocity += wallride_leap_side * last_wall_normal

+ 15
- 14
scripts/player.gd View File

@ -8,9 +8,7 @@ var view_sensitivity = 0.25
var yaw = 0 var yaw = 0
var pitch = 0 var pitch = 0
const air_accel = 0.02
var gravity = -1
var gravity = -.8
var velocity = Vector3() var velocity = Vector3()
slave var slave_tf = Basis() slave var slave_tf = Basis()
slave var slave_vel = Vector3() slave var slave_vel = Vector3()
@ -20,12 +18,15 @@ var timer = 0
# Walking speed and jumping height are defined later. # Walking speed and jumping height are defined later.
var walk_speed = 3 var walk_speed = 3
var jump_speed = 15 var jump_speed = 15
const air_accel = .5
var weight = 1 var weight = 1
var health = 100 var health = 100
var stamina = 10000 var stamina = 10000
var ray_length = 10 var ray_length = 10
var debug_node
func _ready(): func _ready():
set_process_input(true) set_process_input(true)
@ -33,21 +34,20 @@ func _ready():
# Capture mouse once game is started: # Capture mouse once game is started:
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
#set_physics_process(true)
get_node("Crosshair").set_text("+")
debug_node = get_node("/root/world/Debug")
if is_network_master(): if is_network_master():
get_node("Yaw/Camera").make_current() get_node("Yaw/Camera").make_current()
func _input(event): func _input(event):
if is_network_master(): if is_network_master():
if event is InputEventMouseMotion: if event is InputEventMouseMotion:
yaw = fmod(yaw - event.relative.x * view_sensitivity, 360) yaw = fmod(yaw - event.relative.x * view_sensitivity, 360)
pitch = max(min(pitch - event.relative.y * view_sensitivity, 85), -85) pitch = max(min(pitch - event.relative.y * view_sensitivity, 85), -85)
get_node("Yaw").set_rotation(Vector3(0, deg2rad(yaw), 0)) get_node("Yaw").set_rotation(Vector3(0, deg2rad(yaw), 0))
get_node("Yaw/Camera").set_rotation(Vector3(deg2rad(pitch), 0, 0)) get_node("Yaw/Camera").set_rotation(Vector3(deg2rad(pitch), 0, 0))
# Toggle mouse capture: # Toggle mouse capture:
if Input.is_action_pressed("toggle_mouse_capture"): if Input.is_action_pressed("toggle_mouse_capture"):
if (Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED): if (Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED):
@ -56,7 +56,7 @@ func _input(event):
else: else:
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
view_sensitivity = 0.25 view_sensitivity = 0.25
# Quit the game: # Quit the game:
if Input.is_action_pressed("quit"): if Input.is_action_pressed("quit"):
quit() quit()
@ -87,8 +87,7 @@ func control_player(delta):
direction += aim[0] direction += aim[0]
direction = direction.normalized() direction = direction.normalized()
var ray = get_node("Ray")
var friction var friction
if is_on_floor(): if is_on_floor():
@ -108,13 +107,15 @@ func control_player(delta):
velocity.z *= friction velocity.z *= friction
velocity.y += gravity velocity.y += gravity
velocity += direction * air_accel velocity += direction * air_accel
# Just for testing TODO # Just for testing TODO
if Input.is_action_pressed("jump"): if Input.is_action_pressed("jump"):
velocity.y += jump_speed * 0.1 velocity.y += jump_speed * 0.1
move_and_slide(velocity, Vector3(0, 1, 0))
debug_node.set_text("%8.f,%8.f,%8.f" % [velocity.x, velocity.y, velocity.z])
velocity = move_and_slide(velocity, Vector3(0, 1, 0))
for i in range(get_slide_count()): for i in range(get_slide_count()):
var collision = get_slide_collision(i) var collision = get_slide_collision(i)
if collision.collider.is_in_group("objective"): if collision.collider.is_in_group("objective"):


Loading…
Cancel
Save