random
This commit is contained in:
parent
2891773810
commit
3c96d41754
4 changed files with 36 additions and 3 deletions
21
scripts/ads/Ads_normal.gd
Normal file
21
scripts/ads/Ads_normal.gd
Normal file
|
@ -0,0 +1,21 @@
|
|||
extends "res://scripts/ads/ads_default.gd"
|
||||
|
||||
var rng = RandomNumberGenerator.new()
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
$Panel2/Button.disabled = false
|
||||
var images = [ load("res://ressources/assets/NormalAds/PosterCrab2.png")
|
||||
,load("res://ressources/assets/NormalAds/PosterCrab.png")
|
||||
,load("res://ressources/assets/NormalAds/PosterMeow2.png")
|
||||
,load("res://ressources/assets/NormalAds/PosterMeow.png")
|
||||
]
|
||||
var val = rng.randf_range(0, 4)
|
||||
$Sprite2D.set_texture (images[val])
|
||||
|
||||
$Sprite2D.set_offset (Vector2($Sprite2D.texture.get_width()/2, ($Sprite2D.texture.get_height()/2)+30))
|
||||
pass
|
||||
|
||||
|
||||
func _on_button_pressed():
|
||||
condition = true
|
||||
print("pressed")
|
|
@ -5,12 +5,13 @@ extends "res://scripts/ads.gd"
|
|||
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):
|
||||
func _process(delta):
|
||||
close()
|
||||
|
||||
func _on_button_pressed():
|
||||
|
|
Reference in a new issue