ScratchData LogoScratchData
Back to AwesomeSmilee's profile

Top-Down Game AI Raycast Example

AWAwesomeSmilee•Created December 31, 2015
Top-Down Game AI Raycast Example
26
22
937 views
View on Scratch

Description

Drag the player This is a simple example of how raycasting can be used to detect if a player is in an enemy's line of range in a top-down shooter. What it does is a raycasting line goes to the enemy and shoots out in the enemy's peripheral vision range. If it touches a wall or the edge it means that it does not see the player, however if it touches the player that means that the player's detected. Drag the white ball (player) to see the effects. Untick the "run without screen refresh" on the "raycast" custom block to see a single-stepping mode.

Project Details

Project ID92800845
CreatedDecember 31, 2015
Last ModifiedFebruary 5, 2017
SharedDecember 31, 2015
Visibilityvisible
CommentsAllowed