Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates #136

Merged
merged 7 commits into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
workflow_dispatch:

env:
GODOT_VERSION: 3.5.3
GODOT_VERSION: 3.6

jobs:
build:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ Types of changes:

## [Unreleased]

### Added
- Enabled new physics interpolation to make gameplay smoother
- Highlight which player you are when near others

### Changed
- Update Godot to 3.6
- Made the server URLs configurable

## [0.12.0] - 2024-03-11

### Added
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM alpine:3.17.2 as base

# Godot shared environment Variables
ENV GODOT_VERSION "3.5.3"
ENV GODOT_VERSION "3.6"
ENV GODOT_EXPORT_PRESET "linux"

# Install tools for downloading
Expand Down
5 changes: 3 additions & 2 deletions client/client_network.gd
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,9 @@ func is_rpc_from_server() -> bool:


func send_version_info() -> void:
var version: String = ProjectSettings.get_setting("application/config/version")
rpc_id(SERVER_ID, "receive_version_info", version)
var game_name : String = ProjectSettings.get_setting("application/config/name") + " " + File.new().get_sha256(ProjectSettings.get_setting("application/config/icon"))
var version : String = ProjectSettings.get_setting("application/config/version")
rpc_id(SERVER_ID, "receive_version_info", game_name, version)


func send_clock_sync_request() -> void:
Expand Down
22 changes: 22 additions & 0 deletions client/world/player/player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ var enable_death: bool = true
var player_name: String
var body_colour: Color
var flap_queue: Array
var players_nearby := 0


func _ready() -> void:
Expand All @@ -16,6 +17,7 @@ func _ready() -> void:
var start_time = rand_range(0, $AnimationPlayer.get_current_animation_length())
$AnimationPlayer.seek(start_time)
$AnimationPlayer.play()
$VisibleBody/Sprites/GlowOutline.hide()


func _physics_process(_delta: float) -> void:
Expand Down Expand Up @@ -73,12 +75,14 @@ func enable_control() -> void:
if not is_controlled:
is_controlled = true
$Listener2D.make_current()
$VisibleBody/Sprites/GlowOutline.show()


func disable_control() -> void:
if is_controlled:
is_controlled = false
$Listener2D.clear_current()
$VisibleBody/Sprites/GlowOutline.hide()


func set_body_colour(value: int) -> void:
Expand Down Expand Up @@ -158,3 +162,21 @@ func add_coin(amount: int = 1) -> void:
func add_item(item: Item) -> void:
.add_item(item)
$Item.play()


func _on_PlayerNearbyDetector_body_entered(body: Node) -> void:
if body == self:
# Don't count ourselves
return
if players_nearby == 0:
$VisibleBody/Sprites/GlowOutline/GlowAnimator.play("glow")
players_nearby += 1


func _on_PlayerNearbyDetector_body_exited(body: Node) -> void:
if body == self:
# Don't count ourselves
return
if players_nearby == 1:
$VisibleBody/Sprites/GlowOutline/GlowAnimator.play("RESET")
players_nearby -= 1
105 changes: 97 additions & 8 deletions client/world/player/player.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=46 format=2]
[gd_scene load_steps=51 format=2]

[ext_resource path="res://client/world/player/flappo.png" type="Texture" id=1]
[ext_resource path="res://client/world/player/white_square_64px.png" type="Texture" id=2]
Expand Down Expand Up @@ -42,6 +42,74 @@ _data = [ Vector2( 0, 0.256757 ), 0.0, 0.743243, 0, 1, Vector2( 1, 1 ), 0.743243
interpolation_mode = 2
colors = PoolColorArray( 1, 1, 1, 0, 1, 1, 1, 0.337255 )

[sub_resource type="Gradient" id=19]
interpolation_mode = 2
offsets = PoolRealArray( 0.331412, 0.397695 )
colors = PoolColorArray( 1, 1, 1, 1, 1, 1, 1, 0 )

[sub_resource type="GradientTexture2D" id=20]
gradient = SubResource( 19 )
width = 128
height = 128
fill = 1
fill_from = Vector2( 0.5, 0.5 )

[sub_resource type="Animation" id=21]
length = 0.001
tracks/0/type = "value"
tracks/0/path = NodePath(".:self_modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Color( 1, 1, 1, 0 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath(".:scale")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Vector2( 1, 1 ) ]
}

[sub_resource type="Animation" id=22]
resource_name = "glow"
length = 0.7
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath(".:scale")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.3 ),
"transitions": PoolRealArray( 2, 2 ),
"update": 0,
"values": [ Vector2( 0.85, 0.85 ), Vector2( 1.05, 1.05 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath(".:self_modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Color( 1, 1, 1, 1 ) ]
}

[sub_resource type="SpriteFrames" id=5]
animations = [ {
"frames": [ ExtResource( 20 ), ExtResource( 21 ), ExtResource( 17 ), ExtResource( 19 ), ExtResource( 18 ) ],
Expand Down Expand Up @@ -403,6 +471,9 @@ scale = 6.71
scale_random = 1.0
color_ramp = SubResource( 17 )

[sub_resource type="CircleShape2D" id=23]
radius = 100.0

[node name="Player" instance=ExtResource( 9 )]
script = ExtResource( 8 )
ImpactParticles = ExtResource( 22 )
Expand All @@ -421,52 +492,61 @@ script = ExtResource( 23 )
[node name="Sprites" type="Node2D" parent="VisibleBody" index="1"]
z_index = 2

[node name="Body" type="Sprite" parent="VisibleBody/Sprites" index="0"]
[node name="GlowOutline" type="Sprite" parent="VisibleBody/Sprites" index="0"]
modulate = Color( 0.388235, 1, 0.235294, 1 )
self_modulate = Color( 1, 1, 1, 0 )
texture = SubResource( 20 )

[node name="GlowAnimator" type="AnimationPlayer" parent="VisibleBody/Sprites/GlowOutline" index="0"]
anims/RESET = SubResource( 21 )
anims/glow = SubResource( 22 )

[node name="Body" type="Sprite" parent="VisibleBody/Sprites" index="1"]
modulate = Color( 0.839216, 0.141176, 0.0666667, 1 )
texture = ExtResource( 1 )
hframes = 2
vframes = 7
region_rect = Rect2( 0, 0, 128, 448 )

[node name="BodyOutline" type="Sprite" parent="VisibleBody/Sprites" index="1"]
[node name="BodyOutline" type="Sprite" parent="VisibleBody/Sprites" index="2"]
modulate = Color( 0.839216, 0.141176, 0.0666667, 1 )
texture = ExtResource( 1 )
hframes = 2
vframes = 7
frame = 2
region_rect = Rect2( 0, 0, 128, 448 )

[node name="Wing" type="Sprite" parent="VisibleBody/Sprites" index="2"]
[node name="Wing" type="Sprite" parent="VisibleBody/Sprites" index="3"]
modulate = Color( 0.839216, 0.141176, 0.0666667, 1 )
texture = ExtResource( 1 )
hframes = 2
vframes = 7
frame = 4
region_rect = Rect2( 0, 0, 128, 448 )

[node name="Eyes" type="Sprite" parent="VisibleBody/Sprites" index="3"]
[node name="Eyes" type="Sprite" parent="VisibleBody/Sprites" index="4"]
texture = ExtResource( 1 )
hframes = 2
vframes = 7
frame = 6
region_rect = Rect2( 0, 0, 128, 448 )

[node name="EyesOutline" type="Sprite" parent="VisibleBody/Sprites" index="4"]
[node name="EyesOutline" type="Sprite" parent="VisibleBody/Sprites" index="5"]
modulate = Color( 0.839216, 0.141176, 0.0666667, 1 )
texture = ExtResource( 1 )
hframes = 2
vframes = 7
frame = 8
region_rect = Rect2( 0, 0, 128, 448 )

[node name="Beak" type="Sprite" parent="VisibleBody/Sprites" index="5"]
[node name="Beak" type="Sprite" parent="VisibleBody/Sprites" index="6"]
texture = ExtResource( 1 )
hframes = 2
vframes = 7
frame = 10
region_rect = Rect2( 0, 0, 128, 448 )

[node name="BeakOutline" type="Sprite" parent="VisibleBody/Sprites" index="6"]
[node name="BeakOutline" type="Sprite" parent="VisibleBody/Sprites" index="7"]
modulate = Color( 0.839216, 0.141176, 0.0666667, 1 )
texture = ExtResource( 1 )
hframes = 2
Expand Down Expand Up @@ -624,3 +704,12 @@ texture = ExtResource( 33 )

[node name="Flomb" parent="." index="22"]
flomb_projectile = ExtResource( 34 )

[node name="PlayerNearbyDetector" type="Area2D" parent="." index="23"]
collision_layer = 0

[node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerNearbyDetector" index="0"]
shape = SubResource( 23 )

[connection signal="body_entered" from="PlayerNearbyDetector" to="." method="_on_PlayerNearbyDetector_body_entered"]
[connection signal="body_exited" from="PlayerNearbyDetector" to="." method="_on_PlayerNearbyDetector_body_exited"]
10 changes: 5 additions & 5 deletions common/singletons/network.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ extends Node

const CLIENT_NETWORK = "res://client/client_network.tscn"
const SERVER_NETWORK = "res://server/server_network.tscn"
const RPC_PORT = 31400
const MAX_PLAYERS = 16
const SERVER_DOMAIN_URL := "https://jibby.games"
const SERVER_LIST_URL := SERVER_DOMAIN_URL + "/api/list"
const SERVER_MANAGER_URL := SERVER_DOMAIN_URL + "/api/manager"

var Client: ClientNetwork
var Server: ServerNetwork

var RPC_PORT: int = ProjectSettings.get_setting("game/config/rpc_port")
var MAX_PLAYERS: int = ProjectSettings.get_setting("game/config/max_players")
var SERVER_DOMAIN_URL: String = ProjectSettings.get_setting("game/config/server_domain_url")
var SERVER_LIST_URL: String = SERVER_DOMAIN_URL + ProjectSettings.get_setting("game/config/server_list_route")
var SERVER_MANAGER_URL: String = SERVER_DOMAIN_URL + ProjectSettings.get_setting("game/config/server_manager_route")
var X509_CERT_PATH := "user://certs/X509_certificate.crt"
var X509_KEY_PATH := "user://certs/X509_key.key"
var X509_CERT: Resource
Expand Down
53 changes: 34 additions & 19 deletions export_presets.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ codesign/description=""
codesign/custom_options=PoolStringArray( )
application/modify_resources=true
application/icon="res://icon.ico"
application/icon_interpolation=4
application/file_version=""
application/product_version=""
application/company_name="Jibby Games"
Expand All @@ -56,34 +57,33 @@ script_encryption_key=""

[preset.1.options]

export/distribution_type=1
custom_template/debug=""
custom_template/release=""
application/name="Flappy Race"
application/info="Made with Godot Engine"
application/icon="res://icon.png"
application/icon_interpolation=4
application/identifier="games.jibby.flappy-race"
application/signature=""
application/app_category="Games"
application/short_version=""
application/version=""
application/copyright=""
application/min_macos_version="10.12"
display/high_res=true
privacy/microphone_usage_description=""
privacy/camera_usage_description=""
privacy/location_usage_description=""
privacy/address_book_usage_description=""
privacy/calendar_usage_description=""
privacy/photos_library_usage_description=""
privacy/desktop_folder_usage_description=""
privacy/documents_folder_usage_description=""
privacy/downloads_folder_usage_description=""
privacy/network_volumes_usage_description=""
privacy/removable_volumes_usage_description=""
codesign/enable=true
xcode/platform_build="14C18"
xcode/sdk_version="13.1"
xcode/sdk_build="22C55"
xcode/sdk_name="macosx13.1"
xcode/xcode_version="1420"
xcode/xcode_build="14C18"
codesign/codesign=1
codesign/installer_identity=""
codesign/apple_team_id=""
codesign/identity=""
codesign/timestamp=true
codesign/hardened_runtime=true
codesign/replace_existing_signature=true
codesign/certificate_file=""
codesign/certificate_password=""
codesign/provisioning_profile=""
codesign/entitlements/custom_file=""
codesign/entitlements/allow_jit_code_execution=false
codesign/entitlements/allow_unsigned_executable_memory=false
Expand All @@ -106,11 +106,25 @@ codesign/entitlements/app_sandbox/files_downloads=0
codesign/entitlements/app_sandbox/files_pictures=0
codesign/entitlements/app_sandbox/files_music=0
codesign/entitlements/app_sandbox/files_movies=0
codesign/entitlements/app_sandbox/files_user_selected=0
codesign/custom_options=PoolStringArray( )
notarization/enable=false
notarization/notarization=0
notarization/apple_id_name=""
notarization/apple_id_password=""
notarization/apple_team_id=""
notarization/api_uuid=""
notarization/api_key=""
notarization/api_key_id=""
privacy/microphone_usage_description=""
privacy/camera_usage_description=""
privacy/location_usage_description=""
privacy/address_book_usage_description=""
privacy/calendar_usage_description=""
privacy/photos_library_usage_description=""
privacy/desktop_folder_usage_description=""
privacy/documents_folder_usage_description=""
privacy/downloads_folder_usage_description=""
privacy/network_volumes_usage_description=""
privacy/removable_volumes_usage_description=""
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
Expand All @@ -132,7 +146,7 @@ script_encryption_key=""

custom_template/debug=""
custom_template/release=""
binary_format/64_bits=true
binary_format/architecture="x86_64"
binary_format/embed_pck=false
texture_format/bptc=false
texture_format/s3tc=true
Expand Down Expand Up @@ -280,6 +294,7 @@ permissions/mount_format_filesystems=false
permissions/mount_unmount_filesystems=false
permissions/nfc=false
permissions/persistent_activity=false
permissions/post_notifications=false
permissions/process_outgoing_calls=false
permissions/read_calendar=false
permissions/read_call_log=false
Expand Down
Loading
Loading