Commit e3d5645a authored by Steven vanZyl's avatar Steven vanZyl
Browse files

update licenses

parent b928b440
MIT License
Copyright (c) <year> <copyright holders>
Copyright (c) 2019 Steven vanZyl
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
# Adapted from the code by
# Licensed under the MIT License.
# Copyright (c) 2018 Jaccomo Lorenz (Maujoe)
# which can be found here https://github.com/Maujoe/godot-camera-control
extends KinematicBody
......
extends KinematicBody
const FLOOR = Vector3(0, 0, 1)
export (int) var speed = 50
export (float) var mouse_sensitivity = 0.10
var tmp_paint_color = Color()
var paint_color = Color()
var velocity = Vector3()
onready var rot_h = $RotationHelper
onready var camera = $RotationHelper/Camera
onready var gui = $RotationHelper/Camera/Control
var paint = preload("res://Paint.tscn")
func _ready():
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
gui.hide()
func _physics_process(delta):
# Open and close the color select menu
var in_menu = Input.get_mouse_mode() == Input.MOUSE_MODE_VISIBLE
if Input.is_action_just_pressed("action_color") or Input.is_action_just_pressed("ui_cancel"):
if in_menu:
gui.hide()
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
paint_color = tmp_paint_color
print(paint_color)
else:
gui.show()
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
# Don't do movement in the menu
if in_menu:
return
# Paint the trail
if Input.is_action_pressed("action_paint"):
var p = paint.instance()
p.set_color(paint_color)
p.set_translation(translation)
get_tree().root.add_child(p)
var input_vel = Vector3()
# Handle movement inputs
if Input.is_action_pressed("move_forward"):
input_vel.y += 1
if Input.is_action_pressed("move_backward"):
input_vel.y -= 1
if Input.is_action_pressed("move_left"):
input_vel.x += 1
if Input.is_action_pressed("move_right"):
input_vel.x -= 1
if Input.is_action_pressed("move_up"):
input_vel.z += 1
if Input.is_action_pressed("move_down"):
input_vel.z -= 1
input_vel = input_vel.normalized()
# Calculate the looked direction
var dir = Vector3() # Where does the player intend to walk to
var cam_xform = camera.get_global_transform()
dir += -cam_xform.basis.x.normalized() * input_vel.x
dir += cam_xform.basis.z.normalized() * input_vel.y
dir += cam_xform.basis.y.normalized() * input_vel.z
# dir = dir.normalized()
velocity = input_vel * dir * speed
# print("dir: " + str(dir))
# print("velocity: " + str(velocity))
velocity = move_and_slide(velocity, FLOOR)
func _input(event):
if event is InputEventMouseMotion and Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
rot_h.rotate_x(deg2rad(event.relative.y * mouse_sensitivity * -1))
self.rotate_y(deg2rad(event.relative.x * mouse_sensitivity * -1))
var camera_rot = rot_h.rotation_degrees
camera_rot.x = clamp(camera_rot.x, -70, 70)
rot_h.rotation_degrees = camera_rot
# ===== Signals =====
func _on_ColorPicker_color_changed(color):
tmp_paint_color = color
func _set_nameplate(name):
$Nameplate/Viewport/Label.text = name
......@@ -32,7 +32,7 @@ custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="/home/steven/Desktop/picasso-windows/picasso.exe"
export_path="/home/steven/Desktop/picasso-win/picasso.exe"
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""
......@@ -48,8 +48,8 @@ binary_format/64_bits=true
custom_template/release=""
custom_template/debug=""
application/icon=""
application/file_version="0.0.1"
application/product_version="0.0.1"
application/file_version="0.2.0"
application/product_version="0.2.0"
application/company_name="Steven vanZyl"
application/product_name="Picasso"
application/file_description=""
......
......@@ -4,3 +4,8 @@ semi-functional state and are mostly just for my own education and fun.
Despite my dislike for Monorepos I have decided that it is appropriate to store
these since most of these games are one-off things that I stop touching after I'm done.
Most of these games are in the [Godot Engine](https://godotengine.org)
because it's FOSS and I quite like it.
All code is under the MIT License which you can read in the [LICENSE file](./LICENSE)
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment