SShortSingh.
Back to feed

Godot 4 Hitbox and Hurtbox System Explained: Damage, Teams, and Knockback

0
·1 views

A developer tutorial on DEV Community breaks down how to implement a clean hitbox and hurtbox system in Godot 4 for action games. The guide clarifies that a Hitbox is an Area2D attached to an attack source that scans for targets, while a Hurtbox is an Area2D on damageable objects that only needs to be detected. Using Godot's collision_layer and collision_mask properties on a dedicated layer, developers can ensure hitboxes detect only hurtboxes and avoid unintended collisions. The tutorial also covers team-based friendly fire prevention, invincibility frames after taking damage, and knockback direction logic. For those who prefer a ready-made solution, the author points to the Saltmire Hitbox plugin on itch.io, which packages these features with no manual layer configuration required.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingHacker News ·

AI Uncovers Security Bugs in OpenVM's Zero-Knowledge Virtual Machine

ZKSecurity published a blog post detailing how artificial intelligence was used to audit OpenVM, a zero-knowledge virtual machine. The research represents a follow-up effort in applying AI tools to cryptographic code review. The AI analysis reportedly identified vulnerabilities within the zkVM implementation. The findings highlight a growing trend of using machine learning techniques to strengthen cryptographic security audits. The post was shared on Hacker News, drawing attention from the security and cryptography community.

0
ProgrammingDEV Community ·

Simple LLM Habits Most Developers Miss, According to a Seasoned Engineer

A developer writing on DEV Community argues that most people adopted poor habits when large language models quietly entered their workflows without any formal training or guidance. The author's core advice is to always prompt the model for a second pass — asking it to identify flaws or gaps in its own output — before treating any result as final. While this self-review trick catches surface-level errors cheaply, the author stresses it does not replace human judgment, particularly when choosing between multiple valid solutions under real-world constraints. The piece also pushes back on debates over LLM code style, arguing cosmetic preferences should be automated via linters rather than debated by engineers. The central warning is that outsourcing one's own reasoning to the model entirely inverts the relationship — making the tool the decision-maker rather than the developer.

0
ProgrammingDEV Community ·

Developer builds PWAA format to run full web apps offline without CORS issues

A developer has created PWAA (Portable Web Application Archive), a new file format designed to package entire web applications, including HTML, CSS, JavaScript, and media, into a single double-clickable file. Existing offline formats such as EPUB, MHTML, and CHM were deemed inadequate for modern interactive apps due to JavaScript sandboxing, CORS restrictions, and lack of SPA routing support. PWAA works by mapping a standard ZIP container's contents to memory and spinning up an ephemeral in-memory HTTP server on localhost, tricking the web code into behaving as if it were running on a live server. This approach bypasses CORS restrictions, supports SPA routing via a fallback mechanism that serves index.html for unmatched paths, and enables video streaming through a RAM-buffering strategy. The reference reader and builder were written in Go, and the format aims to free developers from cloud hosting dependencies for distributing interactive web content.

0
ProgrammingHacker News ·

Live SSH Honeypot Lets You Watch Automated Bots Attack in Real Time

A developer has launched a public SSH honeypot at honeypotlive.cc that allows anyone to observe bot activity in real time. The tool acts as a decoy server, luring automated scripts and bots that scan the internet for vulnerable SSH connections. Visitors can watch live as bots attempt to log in, revealing common attack patterns and credentials used by malicious actors. The project was shared on Hacker News as a demonstration tool, offering a transparent look at the scale of automated cyber threats targeting SSH services.

Godot 4 Hitbox and Hurtbox System Explained: Damage, Teams, and Knockback · ShortSingh