Giter Club home page Giter Club logo

godot-3-2d-day-night-cycle's People

Contributors

hiulit avatar mitchcurtis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

godot-3-2d-day-night-cycle's Issues

Question about day_duration

day_duration is initially set to minutes:

export (float) var day_duration = 0.5 # In minutes

then it's converted to seconds:

day_duration = 60 * 60 * day_duration # Convert 'day_duration' from minutes to seconds

but there are only 60 seconds in a minute, so why does it multiply the result by 60 again?

I ask because I'm currently looking into an issue with my game and to fix it I need to understand this code.

Where in the tree is the Tweener supposed to be created?

version 4.2.1
@onready var color_transition_tween = $ColorTransitionTween
@onready var color_transition_tween = create_tweener() #self doesn't work
@onready var color_transition_tween = get_tree().create_tweener() #Node2D doesn't work
@onready var color_transition_tween = get_parent().create_tweener() #same target as before in most cases

I think it should be:

@onready var color_transition_tween = get_tree().create_tween()
func _ready():
	color_transition_tween.set_trans(Tween.TRANS_SINE)
	color_transition_tween.set_ease(Tween.EASE_OUT)

But this raises the following errors:
"Tween started with no tweeners" and,
"Tween invalid. Either finished or created outside scene tree"

and the transition looks as follows:

color_transition_tween.tween_property(self, "color", color_night, GlobalTime.state_transition_duration)
await color_transition_tween.finished

image

seconds_elapsed_remainder disregarded

Hey there - was playing with your project and noticed that in the main timer you overwrite seconds_elapsed_remainder each time _physics_process gets called, so fractions of a second are potentially getting lost every cycle. Change to "seconds_elapsed_remainder += delta * IN_GAME_SECONDS_PER_REAL_TIME_SECONDS" fixes this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.