Ad managment system problem,help please!

Yes i will do now

in godot its very bad its not even opening my game i press space and after it i stay in my menu

hm okay. Can you send the link to the documentation again?

1 Like

Hm remove this from Menu.gd:

	if get_tree().current_scene.has_signal("player_died_signal"):
		get_tree().current_scene.connect("player_died_signal", self, "_show_ad")
1 Like

i have removed thisbut is it normal that my game doesnt open in godot ?

No normally it should start. Are there error messages?

β€” Debugging process started β€”
Godot Engine v3.5.3.stable.official.6c814135b - https://godotengine.org
OpenGL ES 3.0 Renderer: GeForce GTX 550 Ti/PCIe/SSE2
Async. shader compilation: OFF

Game started
Loaded highscore: 36
Bridge.advertisement is initialized
Connected interstitial_state_changed signal
State: closed
Stateclosed
Ad closed or failed
Changing scene to Menu
Setting highscore label to Russian
Game started
Loaded highscore: 36
Bridge.advertisement is initialized
Connected interstitial_state_changed signal
State: closed
Stateclosed
Ad closed or failed
Changing scene to Menu
Setting highscore label to Russian
β€” Debugging process stopped β€”
scene/resources/resource_format_text.cpp:1143 - res://default_env.tres:1 - Parse Error:
it just dont go to the game scene(i think there is no add because of it)
no i exported my game and now its dont open (i mean when i press space dont go to game scene)

Okay but this is looking good. First delete this from Game.gd:

func _ready():
    ...
    if Bridge.advertisement:
		print("Bridge.advertisement is initialized")
		Bridge.advertisement.connect("interstitial_state_changed", self, "_on_interstitial_state_changed")
		print("Connected interstitial_state_changed signal")
		Bridge.advertisement.emit_signal("interstitial_state_changed", "closed")

func _on_interstitial_state_changed(state):
	print("State", state)
	if state == "closed" or state == "failed":
		print("Ad closed or failed")
		AdManager.reset_ad_timer()  
		BgMusic.set_stream_paused(false)
		print("Changing scene to Menu")
		get_tree().change_scene("res://Scenes/Menu.tscn")    
	elif state == "opened":
		print("Ad opened")
		BgMusic.set_stream_paused(true)
	else:
		print("Ad state unknown: ", state)
		BgMusic.set_stream_paused(false)	

Then it possibly should work

1 Like

Thank you very much it finally works!!! :+1: :+1: :+1: :+1: :+1: :+1:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.