Skip to content

Commit

Permalink
Added more fun to yank andy
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-ruehl committed Apr 2, 2017
1 parent c68be37 commit a7dca77
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 74 deletions.
6 changes: 2 additions & 4 deletions src/levels/minigames/yankandy/ball_script.gd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func _fixed_process(delta):

randomize()
var random_friction = randf()*0.3+0.05
var random_bounce = randf()*0.4+0.09
var random_bounce = randf()*0.8+0.09

self.set_friction(random_friction)
self.set_bounce(random_bounce)
Expand All @@ -33,7 +33,7 @@ func _fixed_process(delta):
if Input.is_action_pressed("ui_down") and released == false:
print("Release!")
released = true
set_mass(85)
set_mass(95)
set_gravity_scale(0.8)
direction += Vector2(0,0.01)

Expand All @@ -43,8 +43,6 @@ func _fixed_process(delta):
get_node("Camera2D").set_pos(ballpos + variance)

self.set_pos(ballpos + direction)
get_node("../ball_effects").set_pos(ballpos)

func _ready():
set_fixed_process(true)
set_mass(1)
Expand Down
5 changes: 5 additions & 0 deletions src/levels/minigames/yankandy/board_1.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ stream/stream = ExtResource( 3 )

[node name="pins" type="Area2D" parent="."]

editor/display_folded = true
transform/pos = Vector2( 327.45, 178.678 )
input/pickable = true
gravity_vec = Vector2( 0, 1 )
Expand Down Expand Up @@ -1161,6 +1162,10 @@ editor/display_folded = true
transform/pos = Vector2( 51.6378, -34.5576 )
z/z = 0

[node name="Sprite" parent="Yan"]

frame = 1

[node name="ParticleAttractor2D1" parent="Yan"]

transform/pos = Vector2( 52.7836, -16.0314 )
Expand Down
Binary file modified src/levels/minigames/yankandy/sprite_candyball.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions src/levels/minigames/yankandy/sprite_candyball.png.flags
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
filter=true
gen_mipmaps=true
anisotropic=true
mirroredrepeat=true
Binary file modified src/levels/minigames/yankandy/wooden-box-bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
96 changes: 29 additions & 67 deletions src/levels/minigames/yankandy/yankandy.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=15 format=1]
[gd_scene load_steps=12 format=1]

[ext_resource path="res://src/levels/minigames/yankandy/yankandy.gd" type="Script" id=1]
[ext_resource path="res://src/screens/hud/mobile_ui_yankandy.tscn" type="PackedScene" id=2]
Expand All @@ -7,17 +7,14 @@
[ext_resource path="res://src/levels/minigames/yankandy/ball_script.gd" type="Script" id=5]
[ext_resource path="res://src/levels/minigames/yankandy/sprite_candyball.png" type="Texture" id=6]
[ext_resource path="res://src/levels/minigames/yankandy/candyball_light.png" type="Texture" id=7]
[ext_resource path="res://src/levels/minigames/yankandy/sprite_candyball_shadow.png" type="Texture" id=8]
[ext_resource path="res://src/levels/minigames/yankandy/sprite_candyball_shine.png" type="Texture" id=9]
[ext_resource path="res://src/levels/minigames/yankandy/sprite_candyball_shading.png" type="Texture" id=10]
[ext_resource path="res://src/levels/minigames/yankandy/board_1.tscn" type="PackedScene" id=11]
[ext_resource path="res://src/screens/hud/hud.tscn" type="PackedScene" id=12]
[ext_resource path="res://src/audio/sfx/sfx.tscn" type="PackedScene" id=13]
[ext_resource path="res://src/levels/minigames/yankandy/board_1.tscn" type="PackedScene" id=8]
[ext_resource path="res://src/screens/hud/hud.tscn" type="PackedScene" id=9]
[ext_resource path="res://src/audio/sfx/sfx.tscn" type="PackedScene" id=10]

[sub_resource type="CircleShape2D" id=1]
[sub_resource type="ConvexPolygonShape2D" id=1]

custom_solver_bias = 0.0
radius = 24.9706
points = Vector2Array( 20.4398, 17.8697, 8.19275, 26.2236, -8.04803, 26.2166, -19.6868, 17.6407, -20.5035, -3.59482, -4.37268, -26.6681, 6.9762, -26.6578, 20.1299, -2.77808 )

[node name="yankandy" type="Node2D"]

Expand Down Expand Up @@ -187,17 +184,16 @@ texture = ExtResource( 4 )

transform/pos = Vector2( 247, -68 )
transform/scale = Vector2( 0.5, 0.5 )
z/z = 1
input/pickable = false
shapes/0/shape = SubResource( 1 )
shapes/0/transform = Matrix32( 0.5, 0, 0, 0.5, 0, 0 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
mode = 0
mass = 0.01
friction = 0.25
bounce = 0.0
mass = 1.0
friction = 0.0
bounce = 0.8
gravity_scale = 0.0
custom_integrator = false
continuous_cd = 0
Expand All @@ -211,19 +207,27 @@ damp_override/linear = -1.0
damp_override/angular = -1.0
script/script = ExtResource( 5 )

[node name="CollisionShape2D" type="CollisionShape2D" parent="ball"]
[node name="CollisionShape2D" type="CollisionPolygon2D" parent="ball"]

transform/scale = Vector2( 0.5, 0.5 )
shape = SubResource( 1 )
z/z = 1
build_mode = 0
polygon = Vector2Array( 20.1299, -2.77808, 6.9762, -26.6578, -4.37268, -26.6681, -20.5035, -3.59482, -19.6868, 17.6407, -8.04803, 26.2166, 8.19275, 26.2236, 20.4398, 17.8697 )
shape_range = Vector2( 0, 0 )
trigger = false
_update_shape_index = 0

[node name="ball_sprite" type="Sprite" parent="ball"]

transform/scale = Vector2( 0.5, 0.5 )
z/z = 1
texture = ExtResource( 6 )

[node name="ball_sprite1" type="Sprite" parent="ball/ball_sprite"]

visibility/blend_mode = 3
z/z = 1
texture = ExtResource( 6 )

[node name="Camera2D" type="Camera2D" parent="ball"]

visibility/visible = false
Expand All @@ -249,15 +253,16 @@ __meta__ = { "_edit_lock_":true }
[node name="Light2D" type="Light2D" parent="ball"]

visibility/light_mask = 2
transform/pos = Vector2( 0, -1.52588e-05 )
transform/scale = Vector2( 0.125, 0.125 )
transform/pos = Vector2( -0.277783, 0.463065 )
transform/scale = Vector2( 0.0941103, 0.111335 )
z/z = -1
enabled = true
editor_only = false
texture = ExtResource( 7 )
offset = Vector2( 0, 0 )
scale = 1.5
color = Color( 1, 1, 1, 1 )
energy = 0.5
scale = 1.8
color = Color( 0.750843, 0.820312, 0.46463, 1 )
energy = 0.59
mode = 0
range/height = 0.0
range/z_min = -1024
Expand All @@ -271,57 +276,14 @@ shadow/buffer_size = 2048
shadow/esm_multiplier = 80.0
shadow/item_mask = 1

[node name="ball_effects" type="RigidBody2D" parent="."]

transform/pos = Vector2( 243, -116 )
transform/scale = Vector2( 0.5, 0.5 )
z/z = 2
input/pickable = false
collision/layers = 1
collision/mask = 1
mode = 1
mass = 0.00102041
friction = 0.0
bounce = 0.0
gravity_scale = 1.0
custom_integrator = false
continuous_cd = 0
contacts_reported = 0
contact_monitor = false
sleeping = false
can_sleep = true
velocity/linear = Vector2( 0, 0 )
velocity/angular = 0.0
damp_override/linear = -1.0
damp_override/angular = -1.0

[node name="shadow_sprite" type="Sprite" parent="ball_effects"]

visibility/self_opacity = 0.290481
transform/pos = Vector2( 0.648827, 1.72646 )
z/z = -1
texture = ExtResource( 8 )

[node name="highlight_sprite" type="Sprite" parent="ball_effects"]

visibility/blend_mode = 1
transform/pos = Vector2( 0, 3.24816 )
texture = ExtResource( 9 )

[node name="shading_sprite" type="Sprite" parent="ball_effects"]

transform/pos = Vector2( 0.225647, 2.26826 )
texture = ExtResource( 10 )
modulate = Color( 0.457031, 0.176743, 0.176743, 1 )

[node name="board_1" parent="." instance=ExtResource( 11 )]
[node name="board_1" parent="." instance=ExtResource( 8 )]

transform/pos = Vector2( 15, -52 )
mass = 204.082

[node name="hud" parent="." instance=ExtResource( 12 )]
[node name="hud" parent="." instance=ExtResource( 9 )]

[node name="sfx" parent="." instance=ExtResource( 13 )]
[node name="sfx" parent="." instance=ExtResource( 10 )]

[connection signal="pressed" from="hud/go_to_menu" to="hud" method="_on_go_to_menu_pressed"]

Expand Down

0 comments on commit a7dca77

Please sign in to comment.