-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.tscn
More file actions
415 lines (332 loc) · 12.4 KB
/
Main.tscn
File metadata and controls
415 lines (332 loc) · 12.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
[gd_scene load_steps=14 format=1]
[ext_resource path="res://resources/controller/Background.png" type="Texture" id=1]
[ext_resource path="res://resources/controller/Controller_Pad.png" type="Texture" id=2]
[ext_resource path="res://resources/controller/Controller_Joy.png" type="Texture" id=3]
[ext_resource path="res://resources/controller/Controller_Select_Joy.png" type="Texture" id=4]
[ext_resource path="res://resources/controller/Controller_Select_DPad.png" type="Texture" id=5]
[ext_resource path="res://resources/controller/Controller_Select_Start.png" type="Texture" id=6]
[ext_resource path="res://resources/controller/Controller_Select_Button.png" type="Texture" id=7]
[ext_resource path="res://resources/controller/Controller_Select_Trigger_Right.png" type="Texture" id=8]
[ext_resource path="res://resources/controller/Controller_Select_Trigger_Left.png" type="Texture" id=9]
[ext_resource path="res://resources/controller/Controller_Select_Bumper_Right.png" type="Texture" id=10]
[ext_resource path="res://resources/controller/Controller_Select_Bumper_Left.png" type="Texture" id=11]
[sub_resource type="GDScript" id=2]
script/source = "extends Node2D
# class member variables go here, for example:
# var a = 2
# var b = \"textvar\"
var Message = [\"In Broken Mode, the controls are completely broken as a result of a bug. LITERALLY. Some of the controller button works, but unfortunately the Joysticks are a bit messed up.\",
\"In Correct Mode, this is where the joystick controls and the buttons would be properly and syncronized correct and that no errors occur. Sadly, this isnt the case due to bugs.\"]
func _ready():
# Called every time the node is added to the scene.
# Initialization here
set_fixed_process(true)
set_process_input(true)
pass
func _fixed_process(delta):
var debug = get_node(\"../Label\").select
if debug == \"Correct\":
get_node(\"../Message\").set_text(Message[1])
_fixed_controls(delta)
pass
elif debug == \"Broken\":
get_node(\"../Message\").set_text(Message[0])
_broken_controls(delta)
pass
else:
pass
pass
func _input(event):
get_node(\"../Joy_Input\").set_text(var2str(event))
if Input.is_joy_button_pressed(0,0):#Bottom Button
get_node(\"Highlights/Controller_Select_Button_O\").show()
pass
elif Input.is_joy_button_pressed(0,1):#Right Button
get_node(\"Highlights/Controller_Select_Button_A\").show()
pass
elif Input.is_joy_button_pressed(0,2):#Left Button
get_node(\"Highlights/Controller_Select_Button_U\").show()
pass
elif Input.is_joy_button_pressed(0,3):#Top Button
get_node(\"Highlights/Controller_Select_Button_Y\").show()
pass
elif Input.is_joy_button_pressed(0,4):#Left Bumper
get_node(\"Highlights/Controller_Select_Bumper_Left\").show()
pass
elif Input.is_joy_button_pressed(0,5):#Right Bumper
get_node(\"Highlights/Controller_Select_Bumper_Right\").show()
pass
elif Input.is_joy_button_pressed(0,11):#Start Button
get_node(\"Highlights/Controller_Select_Start\").show()
pass
elif Input.is_joy_button_pressed(0,10):#Select Button (UNUSABLE ON OUYA CONTROLLERS)
pass
elif Input.is_joy_button_pressed(0,12):#Up DPad Button
get_node(\"Highlights/Controller_Select_DPad_Up\").show()
pass
elif Input.is_joy_button_pressed(0,13):#Down DPad Button
get_node(\"Highlights/Controller_Select_DPad_Down\").show()
pass
elif Input.is_joy_button_pressed(0,14):#Left DPad Button
get_node(\"Highlights/Controller_Select_DPad_Left\").show()
pass
elif Input.is_joy_button_pressed(0,15):#Right DPad Button
get_node(\"Highlights/Controller_Select_DPad_Right\").show()
pass
elif Input.is_joy_button_pressed(0,8):#Left Joy Button
get_node(\"Controller_Joy_Left/Controller_Select_Joy_Left\").show()
pass
elif Input.is_joy_button_pressed(0,9):#Left Joy Button
get_node(\"Controller_Joy_Right/Controller_Select_Joy_Right\").show()
pass
else:
get_node(\"Controller_Joy_Left/Controller_Select_Joy_Left\").hide()
get_node(\"Controller_Joy_Right/Controller_Select_Joy_Right\").hide()
var c = get_node(\"Highlights\").get_children()
for s in c:
if s == get_node(\"Highlights/Controller_Select_Trigger_Left\"):
pass
elif s == get_node(\"Highlights/Controller_Select_Trigger_Right\"):
pass
else:
s.hide()
pass
func _fixed_controls(d):
var Left_Horizontal = Input.get_joy_axis(0,0)
var Left_Vertical = Input.get_joy_axis(0,1)
var Right_Horizontal = Input.get_joy_axis(0,2)
var Right_Vertical = Input.get_joy_axis(0,3)
# var Left_Joy = Input.is_joy_button_pressed(0,4)
# var Right_Joy = Input.is_joy_button_pressed(0,5)
var Left_Trigger = float(Input.get_joy_axis(0,6))
var Right_Trigger = float(Input.get_joy_axis(0,7))
get_node(\"Controller_Joy_Left\").set_pos(get_node(\"Left_Joy_Position\").get_pos()+Vector2(Left_Horizontal,Left_Vertical)*5)
get_node(\"Controller_Joy_Right\").set_pos(get_node(\"Right_Joy_Position\").get_pos()+Vector2(Right_Horizontal,Right_Vertical)*5)
if Left_Trigger > float(0):
get_node(\"Highlights/Controller_Select_Trigger_Left\").show()
else:
get_node(\"Highlights/Controller_Select_Trigger_Left\").hide()
if Right_Trigger > float(0):
get_node(\"Highlights/Controller_Select_Trigger_Right\").show()
else:
get_node(\"Highlights/Controller_Select_Trigger_Right\").hide()
pass
func _broken_controls(d):
var Left_Horizontal = Input.get_joy_axis(0,1)
var Left_Vertical = Input.get_joy_axis(0,3)
var Right_Horizontal = Input.get_joy_axis(0,0)
var Right_Vertical = Input.get_joy_axis(0,2)
# var Left_Joy = Input.is_joy_button_pressed(0,4)
# var Right_Joy = Input.is_joy_button_pressed(0,5)
var Left_Trigger = float(Input.get_joy_axis(0,6))
var Right_Trigger = float(Input.get_joy_axis(0,7))
get_node(\"Controller_Joy_Left\").set_pos(get_node(\"Left_Joy_Position\").get_pos()+Vector2(Left_Horizontal,Left_Vertical)*5)
get_node(\"Controller_Joy_Right\").set_pos(get_node(\"Right_Joy_Position\").get_pos()+Vector2(0,0)*5)
if Left_Trigger > float(0):
get_node(\"Highlights/Controller_Select_Trigger_Left\").show()
else:
get_node(\"Highlights/Controller_Select_Trigger_Left\").hide()
if Right_Trigger > float(0):
get_node(\"Highlights/Controller_Select_Trigger_Right\").show()
else:
get_node(\"Highlights/Controller_Select_Trigger_Right\").hide()
pass"
[sub_resource type="GDScript" id=1]
script/source = "extends Label
# class member variables go here, for example:
# var a = 2
# var b = \"textvar\"
export (String, \"Correct\",\"Broken\") var select
func _ready():
# Called every time the node is added to the scene.
# Initialization here
set_process_input(true)
set_fixed_process(true)
pass
func _fixed_process(delta):
if select == \"Correct\":
set_text(\"Correct\")
elif select == \"Broken\":
set_text(\"Broken\")
else:
pass
pass
func _input(event):
if Input.is_joy_button_pressed(0,8) and Input.is_joy_button_pressed(0,9):
if select == \"Correct\":
select = \"Broken\"
elif select == \"Broken\":
select = \"Correct\"
else:
pass
else:
pass
pass"
[node name="Node2D" type="Node2D"]
[node name="Background" type="Sprite" parent="."]
transform/pos = Vector2( 199, 112 )
texture = ExtResource( 1 )
[node name="Controller" type="Node2D" parent="."]
script/script = SubResource( 2 )
[node name="Controller_Pad" type="Sprite" parent="Controller"]
transform/pos = Vector2( 199, 153 )
texture = ExtResource( 2 )
[node name="Controller_Joy_Left" type="Sprite" parent="Controller"]
transform/pos = Vector2( 144, 126 )
texture = ExtResource( 3 )
[node name="Controller_Select_Joy_Left" type="Sprite" parent="Controller/Controller_Joy_Left"]
visibility/visible = false
texture = ExtResource( 4 )
[node name="Controller_Joy_Right" type="Sprite" parent="Controller"]
transform/pos = Vector2( 228, 150 )
texture = ExtResource( 3 )
[node name="Controller_Select_Joy_Right" type="Sprite" parent="Controller/Controller_Joy_Right"]
visibility/visible = false
texture = ExtResource( 4 )
[node name="Highlights" type="Node2D" parent="Controller"]
[node name="Controller_Select_DPad_Up" type="Sprite" parent="Controller/Highlights"]
visibility/visible = false
transform/pos = Vector2( 170, 144 )
texture = ExtResource( 5 )
[node name="Controller_Select_DPad_Left" type="Sprite" parent="Controller/Highlights"]
visibility/visible = false
transform/pos = Vector2( 164, 150 )
transform/rot = 90.0
texture = ExtResource( 5 )
[node name="Controller_Select_DPad_Down" type="Sprite" parent="Controller/Highlights"]
visibility/visible = false
transform/pos = Vector2( 170, 156 )
transform/rot = 180.0
texture = ExtResource( 5 )
[node name="Controller_Select_DPad_Right" type="Sprite" parent="Controller/Highlights"]
visibility/visible = false
transform/pos = Vector2( 176, 150 )
transform/rot = 270.0
texture = ExtResource( 5 )
[node name="Controller_Select_Start" type="Sprite" parent="Controller/Highlights"]
visibility/visible = false
transform/pos = Vector2( 199, 159 )
texture = ExtResource( 6 )
[node name="Controller_Select_Button_Y" type="Sprite" parent="Controller/Highlights"]
visibility/visible = false
transform/pos = Vector2( 256, 119 )
texture = ExtResource( 7 )
[node name="Controller_Select_Button_U" type="Sprite" parent="Controller/Highlights"]
visibility/visible = false
transform/pos = Vector2( 246, 129 )
texture = ExtResource( 7 )
[node name="Controller_Select_Button_O" type="Sprite" parent="Controller/Highlights"]
visibility/visible = false
transform/pos = Vector2( 256, 139 )
texture = ExtResource( 7 )
[node name="Controller_Select_Button_A" type="Sprite" parent="Controller/Highlights"]
visibility/visible = false
transform/pos = Vector2( 266, 129 )
texture = ExtResource( 7 )
[node name="Controller_Select_Trigger_Right" type="Sprite" parent="Controller/Highlights"]
visibility/visible = false
transform/pos = Vector2( 239, 89 )
texture = ExtResource( 8 )
centered = false
[node name="Controller_Select_Trigger_Left" type="Sprite" parent="Controller/Highlights"]
visibility/visible = false
transform/pos = Vector2( 122, 89 )
texture = ExtResource( 9 )
centered = false
[node name="Controller_Select_Bumper_Right" type="Sprite" parent="Controller/Highlights"]
visibility/visible = false
transform/pos = Vector2( 233, 92 )
texture = ExtResource( 10 )
centered = false
[node name="Controller_Select_Bumper_Left" type="Sprite" parent="Controller/Highlights"]
visibility/visible = false
transform/pos = Vector2( 120, 92 )
texture = ExtResource( 11 )
centered = false
[node name="Left_Joy_Position" type="Position2D" parent="Controller"]
transform/pos = Vector2( 144, 126 )
[node name="Right_Joy_Position" type="Position2D" parent="Controller"]
transform/pos = Vector2( 228, 150 )
[node name="Label" type="Label" parent="."]
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 172.0
margin/top = 176.0
margin/right = 227.0
margin/bottom = 190.0
text = "INPUT"
align = 1
valign = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
script/script = SubResource( 1 )
select = "Correct"
[node name="Label1" type="Label" parent="."]
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 289.0
margin/top = 101.0
margin/right = 398.0
margin/bottom = 217.0
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "Press the left and right joysticks to adjust setting between \"Correct\" and \"Broken\""
align = 1
valign = 1
autowrap = true
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="Label2" type="Label" parent="."]
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 57.0
margin/top = 2.0
margin/right = 342.0
margin/bottom = 22.0
text = "InputEvent Message (For Debug Purposes):"
align = 1
valign = 1
autowrap = true
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="Joy_Input" type="Label" parent="."]
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 57.0
margin/top = 18.0
margin/right = 342.0
margin/bottom = 38.0
custom_colors/font_color = Color( 0, 0.953125, 1, 1 )
custom_colors/font_color_shadow = Color( 0, 0, 0, 1 )
text = "..."
align = 1
valign = 1
autowrap = true
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="Message" type="Label" parent="."]
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 1.0
margin/top = 38.0
margin/right = 398.0
margin/bottom = 86.0
align = 1
valign = 1
autowrap = true
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1