Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

why isnt my code working

A topic by Aapok created 24 days ago Views: 31 Replies: 2
Viewing posts 1 to 3
Submitted

Yeah i dont know whats keeping my code back

Submitted

extends Node2D

func wait_time(time):

await get_tree().create_timer(time).timeout

var marshmallow = 1

var total_marshmallow = 0

var pls_work = 100000000000

func _inputs(event):

if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.is_pressed():

pls_work -= 1

func _input(event):

if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.is_pressed():

marshmallow += 1

if marshmallow >= 50:

total_marshmallow += 1

marshmallow = 1

else:

print(total_marshmallow + marshmallow)

while marshmallow >= 15:

await wait_time(10)

marshmallow = marshmallow - 5

$MarshmallowLabel.text = ": %s" % total_marshmallow

Submitted

it looks different than that but do i have something wrong with godots timer mecanism