Anri/AdBlockNot
Archived
1
0
Fork 0

mise en place du gameplay

This commit is contained in:
2-1-1-2 2024-01-28 02:34:46 +01:00
parent dbafcd63b5
commit 01110ed3c1
13 changed files with 388 additions and 26 deletions

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://esj5tuyxt4n4"
path="res://.godot/imported/PDP.png-3b4e16e692352ef47d8e45b657730eab.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://models/menu/PDP.png"
dest_files=["res://.godot/imported/PDP.png-3b4e16e692352ef47d8e45b657730eab.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://0gd2ishr4j5x"
path="res://.godot/imported/on_off.png-baadc4b97c853551e531032d85bc6f49.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://models/menu/on_off.png"
dest_files=["res://.godot/imported/on_off.png-baadc4b97c853551e531032d85bc6f49.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dayle54j3fk2g"
path="res://.godot/imported/power_off.png-a248ab7ee41195fdf296c8a390d94648.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://models/menu/power_off.png"
dest_files=["res://.godot/imported/power_off.png-a248ab7ee41195fdf296c8a390d94648.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View file

@ -0,0 +1,20 @@
[gd_scene load_steps=3 format=3 uid="uid://cuvb3sbm2nn44"]
[ext_resource type="PackedScene" uid="uid://n06gkookqeml" path="res://scenes/game/windows/Ads.tscn" id="1_tmtrh"]
[ext_resource type="FontFile" uid="uid://dwgslonlru0ck" path="res://ressources/Battlenet.ttf" id="2_p5m0b"]
[node name="Windows" instance=ExtResource("1_tmtrh")]
[node name="RichTextLabel" type="RichTextLabel" parent="." index="2"]
layout_mode = 0
offset_left = 83.0
offset_top = 143.0
offset_right = 270.0
offset_bottom = 289.0
theme_override_colors/default_color = Color(0, 0, 0, 1)
theme_override_fonts/normal_font = ExtResource("2_p5m0b")
theme_override_font_sizes/normal_font_size = 61
text = "password"
[node name="Timer" parent="." index="3"]
autostart = true

View file

@ -0,0 +1,19 @@
[gd_scene load_steps=4 format=3 uid="uid://djap3t7qr0dje"]
[ext_resource type="PackedScene" uid="uid://n06gkookqeml" path="res://scenes/game/windows/Ads.tscn" id="1_bmr11"]
[ext_resource type="FontFile" uid="uid://dwgslonlru0ck" path="res://ressources/Battlenet.ttf" id="2_606ke"]
[ext_resource type="Script" path="res://scripts/ads/ads_default.gd" id="2_w3vjc"]
[node name="Windows" instance=ExtResource("1_bmr11")]
script = ExtResource("2_w3vjc")
[node name="RichTextLabel" type="RichTextLabel" parent="." index="2"]
layout_mode = 0
offset_left = 83.0
offset_top = 143.0
offset_right = 270.0
offset_bottom = 289.0
theme_override_colors/default_color = Color(0, 0, 0, 1)
theme_override_fonts/normal_font = ExtResource("2_606ke")
theme_override_font_sizes/normal_font_size = 61
text = "sudoku"

104
scenes/game/scr918C.tmp Normal file
View file

@ -0,0 +1,104 @@
[gd_scene load_steps=12 format=3 uid="uid://ur6erv76d2of"]
[ext_resource type="FontFile" uid="uid://dwgslonlru0ck" path="res://ressources/Battlenet.ttf" id="1_7ecbr"]
[ext_resource type="Script" path="res://scripts/game.gd" id="1_orxmr"]
[ext_resource type="Texture2D" uid="uid://c012k8qiyjn4a" path="res://models/RetroWindowsGUI/RetroWindowsGUI/Windows_Button.png" id="2_j8eab"]
[ext_resource type="Texture2D" uid="uid://ca0n6csxw7yd7" path="res://models/RetroWindowsGUI/RetroWindowsGUI/Windows_Button_Pressed.png" id="3_eb8po"]
[ext_resource type="Texture2D" uid="uid://c1s8gaui8k13h" path="res://models/RetroWindowsGUI/Flag.png" id="4_medxy"]
[ext_resource type="Shader" path="res://shaders/oldscreen.gdshader" id="6_7ta02"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_se4f0"]
bg_color = Color(0.764706, 0.764706, 0.764706, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_2mxax"]
draw_center = false
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color(1, 1, 1, 1)
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_mbq4w"]
texture = ExtResource("2_j8eab")
texture_margin_left = 2.0
texture_margin_top = 2.0
texture_margin_right = 2.0
texture_margin_bottom = 2.0
draw_center = false
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_lgpbg"]
texture = ExtResource("3_eb8po")
texture_margin_left = 2.0
texture_margin_top = 2.0
texture_margin_right = 2.0
texture_margin_bottom = 2.0
draw_center = false
[sub_resource type="ShaderMaterial" id="ShaderMaterial_lp2yn"]
shader = ExtResource("6_7ta02")
shader_parameter/SCREEN_HEIGHT = 240.0
[node name="WindowsDesktop" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_orxmr")
[node name="ColorRect" type="ColorRect" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0.45098, 0.509804, 1)
[node name="Panel" type="Panel" parent="."]
layout_mode = 1
anchors_preset = 12
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -54.0
grow_horizontal = 2
grow_vertical = 0
theme_override_styles/panel = SubResource("StyleBoxFlat_se4f0")
[node name="Panel" type="Panel" parent="Panel"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -1.0
offset_right = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_2mxax")
[node name="Button" type="Button" parent="Panel"]
layout_mode = 0
offset_left = 4.0
offset_top = 4.0
offset_right = 118.0
offset_bottom = 50.0
focus_mode = 0
theme_override_colors/font_color = Color(0, 0, 0, 1)
theme_override_fonts/font = ExtResource("1_7ecbr")
theme_override_font_sizes/font_size = 37
theme_override_styles/normal = SubResource("StyleBoxTexture_mbq4w")
theme_override_styles/hover = SubResource("StyleBoxTexture_lgpbg")
text = "Start"
icon = ExtResource("4_medxy")
expand_icon = true
[node name="ColorRect2" type="ColorRect" parent="."]
material = SubResource("ShaderMaterial_lp2yn")
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

View file

@ -1,10 +1,11 @@
[gd_scene load_steps=15 format=3 uid="uid://n06gkookqeml"] [gd_scene load_steps=17 format=3 uid="uid://n06gkookqeml"]
[ext_resource type="FontFile" uid="uid://dwgslonlru0ck" path="res://ressources/Battlenet.ttf" id="1_3xpen"] [ext_resource type="Shader" path="res://shaders/oldscreen.gdshader" id="1_1y06m"]
[ext_resource type="Shader" path="res://shaders/oldscreen.gdshader" id="1_dy2m7"] [ext_resource type="Script" path="res://scripts/ads.gd" id="1_ovuv8"]
[ext_resource type="Texture2D" uid="uid://c012k8qiyjn4a" path="res://models/RetroWindowsGUI/RetroWindowsGUI/Windows_Button.png" id="2_cdjsi"] [ext_resource type="FontFile" uid="uid://dwgslonlru0ck" path="res://ressources/Battlenet.ttf" id="2_ak5sb"]
[ext_resource type="Texture2D" uid="uid://rryuulwvlsqi" path="res://models/RetroWindowsGUI/RetroWindowsGUI/Windows_Button_Inactive.png" id="3_2cafe"] [ext_resource type="Texture2D" uid="uid://c012k8qiyjn4a" path="res://models/RetroWindowsGUI/RetroWindowsGUI/Windows_Button.png" id="3_ydhup"]
[ext_resource type="Texture2D" uid="uid://ca0n6csxw7yd7" path="res://models/RetroWindowsGUI/RetroWindowsGUI/Windows_Button_Pressed.png" id="4_aprk7"] [ext_resource type="Texture2D" uid="uid://rryuulwvlsqi" path="res://models/RetroWindowsGUI/RetroWindowsGUI/Windows_Button_Inactive.png" id="4_qj5eb"]
[ext_resource type="Texture2D" uid="uid://ca0n6csxw7yd7" path="res://models/RetroWindowsGUI/RetroWindowsGUI/Windows_Button_Pressed.png" id="5_kq6ex"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_16my3"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_16my3"]
bg_color = Color(0.831373, 0.815686, 0.784314, 1) bg_color = Color(0.831373, 0.815686, 0.784314, 1)
@ -29,32 +30,39 @@ texture_margin_right = 0.654032
region_rect = Rect2(0, -1.264, 45.529, 24.719) region_rect = Rect2(0, -1.264, 45.529, 24.719)
[sub_resource type="ShaderMaterial" id="ShaderMaterial_y28d3"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_y28d3"]
shader = ExtResource("1_dy2m7") shader = ExtResource("1_1y06m")
shader_parameter/SCREEN_HEIGHT = 240.0 shader_parameter/SCREEN_HEIGHT = 240.0
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_8aptj"] [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_8aptj"]
texture = ExtResource("2_cdjsi") texture = ExtResource("3_ydhup")
texture_margin_left = 2.0 texture_margin_left = 2.0
texture_margin_top = 2.0 texture_margin_top = 2.0
texture_margin_right = 2.0 texture_margin_right = 2.0
texture_margin_bottom = 2.0 texture_margin_bottom = 2.0
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_dlla7"] [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_dlla7"]
texture = ExtResource("3_2cafe") texture = ExtResource("4_qj5eb")
texture_margin_left = 2.0 texture_margin_left = 2.0
texture_margin_top = 2.0 texture_margin_top = 2.0
texture_margin_right = 2.0 texture_margin_right = 2.0
texture_margin_bottom = 2.0 texture_margin_bottom = 2.0
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_jwtvu"] [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_jwtvu"]
texture = ExtResource("4_aprk7") texture = ExtResource("5_kq6ex")
texture_margin_left = 2.0
texture_margin_top = 2.0
texture_margin_right = 2.0
texture_margin_bottom = 2.0
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_0cval"]
texture = ExtResource("4_qj5eb")
texture_margin_left = 2.0 texture_margin_left = 2.0
texture_margin_top = 2.0 texture_margin_top = 2.0
texture_margin_right = 2.0 texture_margin_right = 2.0
texture_margin_bottom = 2.0 texture_margin_bottom = 2.0
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_mmcpo"] [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_mmcpo"]
texture = ExtResource("2_cdjsi") texture = ExtResource("3_ydhup")
texture_margin_left = 2.0 texture_margin_left = 2.0
texture_margin_top = 2.0 texture_margin_top = 2.0
texture_margin_right = 2.0 texture_margin_right = 2.0
@ -69,6 +77,7 @@ offset_right = -1100.0
offset_bottom = -500.0 offset_bottom = -500.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
script = ExtResource("1_ovuv8")
[node name="Panel" type="Panel" parent="."] [node name="Panel" type="Panel" parent="."]
layout_mode = 1 layout_mode = 1
@ -114,12 +123,15 @@ offset_right = -4.0
offset_bottom = 42.0 offset_bottom = 42.0
grow_horizontal = 0 grow_horizontal = 0
theme_override_colors/font_color = Color(0, 0, 0.0392157, 1) theme_override_colors/font_color = Color(0, 0, 0.0392157, 1)
theme_override_fonts/font = ExtResource("1_3xpen") theme_override_fonts/font = ExtResource("2_ak5sb")
theme_override_font_sizes/font_size = 20 theme_override_font_sizes/font_size = 20
theme_override_styles/normal = SubResource("StyleBoxTexture_8aptj") theme_override_styles/normal = SubResource("StyleBoxTexture_8aptj")
theme_override_styles/hover = SubResource("StyleBoxTexture_dlla7") theme_override_styles/hover = SubResource("StyleBoxTexture_dlla7")
theme_override_styles/pressed = SubResource("StyleBoxTexture_jwtvu") theme_override_styles/pressed = SubResource("StyleBoxTexture_jwtvu")
theme_override_styles/disabled = SubResource("StyleBoxTexture_0cval")
theme_override_styles/focus = SubResource("StyleBoxTexture_mmcpo") theme_override_styles/focus = SubResource("StyleBoxTexture_mmcpo")
text = "X" text = "X"
icon_alignment = 1 icon_alignment = 1
expand_icon = true expand_icon = true
[connection signal="pressed" from="Panel2/Button" to="." method="_on_button_pressed"]

View file

@ -1,6 +1,6 @@
[gd_scene format=3 uid="uid://l50emg1kqw4a"] [gd_scene format=3 uid="uid://b4ujwtugvmurm"]
[node name="Windows" type="Control"] [node name="VideoPage" type="Control"]
layout_mode = 3 layout_mode = 3
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0

View file

@ -2,8 +2,8 @@
[ext_resource type="PackedScene" uid="uid://cgdlh6iv2j7we" path="res://scenes/menu/image_menu.tscn" id="1_f4wvw"] [ext_resource type="PackedScene" uid="uid://cgdlh6iv2j7we" path="res://scenes/menu/image_menu.tscn" id="1_f4wvw"]
[ext_resource type="Script" path="res://scenes/menu/menu.gd" id="1_y4d58"] [ext_resource type="Script" path="res://scenes/menu/menu.gd" id="1_y4d58"]
[ext_resource type="Texture2D" uid="uid://bcqdrfm52esft" path="res://models/menu/power_off.png" id="2_4yhxu"] [ext_resource type="Texture2D" uid="uid://dayle54j3fk2g" path="res://models/menu/power_off.png" id="2_4yhxu"]
[ext_resource type="Texture2D" uid="uid://plpafbpfkjd7" path="res://models/menu/PDP.png" id="3_a6fh8"] [ext_resource type="Texture2D" uid="uid://esj5tuyxt4n4" path="res://models/menu/PDP.png" id="3_a6fh8"]
[ext_resource type="FontFile" uid="uid://dwgslonlru0ck" path="res://ressources/Battlenet.ttf" id="3_coatq"] [ext_resource type="FontFile" uid="uid://dwgslonlru0ck" path="res://ressources/Battlenet.ttf" id="3_coatq"]
[node name="Menu" type="Node2D"] [node name="Menu" type="Node2D"]
@ -35,6 +35,7 @@ texture = ExtResource("3_a6fh8")
expand_mode = 1 expand_mode = 1
[node name="Label" type="Label" parent="Menu/NormalStart"] [node name="Label" type="Label" parent="Menu/NormalStart"]
layout_mode = 0
offset_left = 49.0 offset_left = 49.0
offset_top = 2.0 offset_top = 2.0
offset_right = 138.0 offset_right = 138.0
@ -49,6 +50,7 @@ theme_type_variation = &"FlatButton"
text = " " text = " "
[node name="pdp2" type="TextureRect" parent="Menu/InfiniteStart"] [node name="pdp2" type="TextureRect" parent="Menu/InfiniteStart"]
layout_mode = 0
offset_top = -4.26229 offset_top = -4.26229
offset_right = 40.0 offset_right = 40.0
offset_bottom = 35.7377 offset_bottom = 35.7377
@ -56,6 +58,7 @@ texture = ExtResource("3_a6fh8")
expand_mode = 1 expand_mode = 1
[node name="Label" type="Label" parent="Menu/InfiniteStart"] [node name="Label" type="Label" parent="Menu/InfiniteStart"]
layout_mode = 0
offset_left = 49.0 offset_left = 49.0
offset_top = 2.0 offset_top = 2.0
offset_right = 138.0 offset_right = 138.0
@ -71,6 +74,7 @@ text = "
" "
[node name="pdp3" type="TextureRect" parent="Menu/Options"] [node name="pdp3" type="TextureRect" parent="Menu/Options"]
layout_mode = 0
offset_left = 1.0929 offset_left = 1.0929
offset_top = -4.69944 offset_top = -4.69944
offset_right = 41.0929 offset_right = 41.0929
@ -79,6 +83,7 @@ texture = ExtResource("3_a6fh8")
expand_mode = 1 expand_mode = 1
[node name="Label" type="Label" parent="Menu/Options"] [node name="Label" type="Label" parent="Menu/Options"]
layout_mode = 0
offset_left = 49.0 offset_left = 49.0
offset_top = 2.0 offset_top = 2.0
offset_right = 138.0 offset_right = 138.0

28
scripts/ads.gd Normal file
View file

@ -0,0 +1,28 @@
extends Control
var condition = false
# Called when the node enters the scene tree for the first time.
func _ready():
pass
func exit_condition():
return condition
func close():
if exit_condition():
self.visible = false
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
close()
func _on_button_pressed():
print("pressed")
condition = true

View file

@ -0,0 +1,18 @@
extends "res://scripts/ads.gd"
# Called when the node enters the scene tree for the first time.
func _ready():
$Panel2/Button.disabled = true
pass
func exit_condition():
return condition
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
close()
func _on_button_pressed():
print("pressed")

View file

@ -0,0 +1,5 @@
extends "res://scripts/ads/ads_default.gd"
func exit_condition():
return condition

View file

@ -1,20 +1,69 @@
extends Control extends Control
var ads_scene = []
var ads = []
"""
var ads_scene = [preload("res://scenes/game/ads/Ads_password.tscn"),
preload("res://scenes/game/ads/Ads_sudoku.tscn")]
"""
var window = preload("res://scenes/game/windows/Windows.tscn") func getFilePathsByExtension(directoryPath: String, extension: String) -> Array:
var instance = window.instantiate() var dir = DirAccess.open(directoryPath)
if !dir :
printerr("Warning: could not open directory: ", directoryPath)
return []
var filePaths := []
if dir:
dir.list_dir_begin()
var fileName = dir.get_next()
while fileName != "":
if dir.current_is_dir():
print("Found directory: " + fileName)
else:
print("Found file: " + fileName)
if fileName.get_extension() == extension:
var filePath = dir.get_current_dir() + "/" + fileName
filePaths.append(filePath)
fileName = dir.get_next()
else:
print("An error occurred when trying to access the path.")
return filePaths
func new_ads(): func new_ads():
instance.position = Vector2(10.0, 5.0) print("her")
var _size = instance.get_rect() randomize()
print(_size) var _range = randi_range(0, ads_scene.size()-1)
var instance = ads_scene[_range].instantiate()
add_child(instance) # Replace with function body. add_child(instance) # Replace with function body.
var _scale = Vector2(0.5,0.5)
instance.scale = _scale
var _size = instance.get_size() * _scale
print(_size)
instance.position.x = randf_range(1, get_viewport_rect().size.x - (_size.x))
instance.position.y = randf_range(1, get_viewport_rect().size.y - (_size.y*1.5))
ads.push_back(instance)
print(instance.position)
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func load_scene():
var _ads_scene = getFilePathsByExtension("res://scenes/game/ads", "tscn")
for scene in _ads_scene:
ads_scene.push_back(load(scene))
func _ready(): func _ready():
new_ads() load_scene()
print(ads_scene)
for n in 15:
new_ads()
func win():
for ad in ads:
if ad.visible == true :
return false
return true
# Called every frame. 'delta' is the elapsed time since the previous frame. # Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta): func _process(_delta):
pass if win():
pass
print("mettre écran victoire")