Giter Site home page Giter Site logo

godot3_dodge's People

Contributors

cbscribe 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

godot3_dodge's Issues

Particles2D node issue

Hello everyone,

When i try to add "particles2d" node and make the settings like the documentation. Player turns to black.

Actually, i couldn't find how can i change the "Visibility Rect" setting to "Rect3"

Mob animation not used

In Mob.gd the function

func _process(delta):
$AnimatedSprite.play()

is missing. As the guide stands the mobs have an animation but it's simply not played.
Thank you for the introductory guide :)

Clarification request

Hi there. Just went through this tutorial, and it was mostly smooth sailing, but one detail let me scratching my head for a while. I think it should be clarified that when creating the game_over signal, you need to be in the Main scene in order to connect from the player node to the main node. If you're in the Player scene, the main node isn't available. It makes sense in retrospect, but if someone is just following the steps this is a very easy mistake to make, especially since the tutorial doesn't explicitly say you're connecting to Main and not Player. I only figured it out when downloading this source and looking at Main.tscn in text. That's all, thanks!

Particle2D issue

Following the tutorial, I added the Particle2D node at the end, but when I imported the playerGrey_up1.png resource as the 'texture' (as shown in the tutorial instructions) I got a particle trail that was twice as big as the Player icon. I know the Player icon had to be scaled to 0.5, 0.5 size, but there was apparently no way to downscale the particle trail to fit the Player icon. Thus, when moving the Player icon in the game, it would leave a trail of fading supersize (2X size) Player icons - very weird.

Visual scripting?

Can this game be scripted using visual scripting instead of gdscript?

Porblem with Tutorial

I did everything equal to your programm. yours working, my isnt working. The last thing what i need to implement is the music all other i finisched but my Enemies didnt spawn i cant find the issue.

Hope u can look over it.

Main:

extends Node

export (PackedScene) var Mob
var score

func _ready():
randomize()

func game_over():
$ScoreTimer.stop()
$MobTimer.stop()
$HUD.show_game_over()
#get_tree().call_group("mobs", "queue_free")

func new_game():
score = 0
$Player.start($StartPosition.position)
$StartTimer.start()
$HUD.update_score(score)
$HUD.show_message("Get Ready")

func _on_MobTimer_timeout():
$MobPath/MobSpawnLocation.offset = randi()
var mob = Mob.instance()
add_child(mob)
var direction = $MobPath/MobSpawnLocation.rotation + PI / 2
mob.position = $MobPath/MobSpawnLocation.position
direction += rand_range(-PI / 4, PI / 4)
mob.rotation = direction
mob.linear_velocity = Vector2(rand_range(mob.min_speed, mob.max_speed), 0)
mob.linear_velocity = mob.linear_velocity.rotated(direction)

func _on_StartTimer_timeout():
$MobTimer.start()
$ScoreTimer.start()

func _on_ScoreTimer_timeout():
score += 1
$HUD.update_score(score)

Player:

extends Area2D

signal hit

export var speed = 400
var screen_size #size of the game window

func _ready():
screen_size = get_viewport_rect().size
hide()

func _process(delta):
var velocity = Vector2() #The players movment
if Input.is_action_pressed("ui_right"):
velocity.x += 1
if Input.is_action_pressed("ui_left"):
velocity.x -= 1
if Input.is_action_pressed("ui_down"):
velocity.y += 1
if Input.is_action_pressed("ui_up"):
velocity.y -= 1
if velocity.length() >0:
velocity = velocity.normalized() * speed
$AnimatedSprite.play()
else:
$AnimatedSprite.stop()

position += velocity * delta
position.x = clamp(position.x, 0, screen_size.x)
position.y = clamp(position.y, 0, screen_size.y)

if velocity.x != 0:
$AnimatedSprite.animation = "Walk"
$AnimatedSprite.flip_v = false
# See the note below about boolean assignment
$AnimatedSprite.flip_h = velocity.x < 0
elif velocity.y != 0:
$AnimatedSprite.animation = "up"
$AnimatedSprite.flip_v = velocity.y > 0

func _on_Player_body_entered(body):
hide()
emit_signal("hit")
$CollisionShape2D.set_deferred("disabled", true)

func start(pos):
position = pos
show()
$CollisionShape2D.disabled = false

Mob:

extends RigidBody2D

export var min_speed = 150 # Minimum speed range.
export var max_speed = 250 # Maximum speed range.

func _ready():
var mob_types = $AnimatedSprite.frames.get_animation_names()
$AnimatedSprite.animation = mob_types[randi() % mob_types.size()]

func _on_VisibilityNotifier2D_screen_exited():
queue_free()

HUD:

extends CanvasLayer

signal start_game

func show_message(text):
$Message.text = text
$Message.show()
$MessageTimer.start()

func show_game_over():
show_message("Game Over")
# Wait until the MessageTimer has counted down.
yield($MessageTimer, "timeout")
$Message.text = "Dodge the\nCreeps!"
$Message.show()
yield(get_tree().create_timer(1), "timeout")
$StartButton.show()

func update_score(score):
$ScoreLabel.text = str(score)

func _on_StartButton_pressed():
$StartButton.hide()
emit_signal("start_game")

func _on_MessageTimer_timeout():
$Message.hide()

Main:
grafik

Player:
grafik

Mob:
grafik

HUD:
grafik

StartTimer firing after game over

If the player suffers an early death then StartTimer can fire after the game over.

This kicks off MobTimer and ScoreTimer which continue to fire while the menu is displayed.

This can exacerbate the problem because MobTimer will ensure that there are enemies on the screen increasing the likely-hood of an early death next time.

`Parser Error: Identifiers not found: screensize`

extends Area2D

export (int) var speed #how fast the player will move

func _ready():
		screensize = get_viewport_rect().size

func _process(delta):
	var velocity = vector2() #player's movement vector
	if Input.action_pressed("ui_right"):
		velocity.x += 1
	if Input.actio_pressed("ui_left"):
		velocity.x -= 1
	if Input.is_action_pressed("ui_down"):
        velocity.y += 1
	if Input.is_action_pressed("ui_up"):
		velocity.y -= 1
	if velocity.length() > 0:
		velocity = velocity.normalized() * speed
		$AnimatedSprite.play()
	else:
		$AnimatedSprite.stop()
		
	position += velocity * delta
	position.x = clamp(position.x, 0, screensize.x)
	position.y = clamp(position.y, 0, screensize.y)

This is the code from the tutorial. When I tried to run it. It throws error:
Parser Error: Identifiers not found: screensize

Please help

Deathsound is Dead

As the title says I can't get the Deathsound to play. Music plays without issue but whenever 'game over' occurs I get the error: Node not found: DeathSound.

The .wav file is loaded in the streaming box. I listened to and it plays fine in windows. Without the deathsound file the game plays fine.

Anyone else have this issue?

Minor feedback trying to follow along

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.