Discuss Scratch

SkeletonWizard
Scratcher
6 posts

How to add stuff in a sprite-based raycaster?

So, I've been trying to make a doom-esque game but can't figure out how to make items appear, nor enemies. Can anyone help?
Link to project –> https://scratch.mit.edu/projects/305127834/

when green flag clicked
forever
if (E=MC2) then
broadcast [Freak Out]
set [SCIENCE] to [Over 9000]
end
end
wayyyy
Scratcher
500+ posts

How to add stuff in a sprite-based raycaster?

One way to display enemies is to do it the same way you did the level. Create a sprite that is a block, and have it act like the same as the map sprite except that it can move, and chance your rendering engine so that it can see the enemy, along with the map.

I would recommend the enemy be a different color from the wall, and having it be a clone, so that things like having it's own hp, and deleting it is easier.

Delete your Scratch Account

SkeletonWizard
Scratcher
6 posts

How to add stuff in a sprite-based raycaster?

Thanks! So I add a sprite that will be in the map as an enemy, & judging by the distance from the player I switch out the sprite!

Also, I hate Fortnite

Last edited by SkeletonWizard (May 27, 2019 13:32:37)


when green flag clicked
forever
if (E=MC2) then
broadcast [Freak Out]
set [SCIENCE] to [Over 9000]
end
end
SkeletonWizard
Scratcher
6 posts

How to add stuff in a sprite-based raycaster?

P.S. What about items? &… I can't figure out the code

Last edited by SkeletonWizard (May 27, 2019 13:33:05)


when green flag clicked
forever
if (E=MC2) then
broadcast [Freak Out]
set [SCIENCE] to [Over 9000]
end
end
Ender_bro_06
Scratcher
48 posts

How to add stuff in a sprite-based raycaster?

.

Last edited by Ender_bro_06 (May 27, 2019 22:32:13)

Ender_bro_06
Scratcher
48 posts

How to add stuff in a sprite-based raycaster?

wayyyy wrote:

One way to display enemies is to do it the same way you did the level. Create a sprite that is a block, and have it act like the same as the map sprite except that it can move, and chance your rendering engine so that it can see the enemy, along with the map.

I would recommend the enemy be a different color from the wall, and having it be a clone, so that things like having it's own hp, and deleting it is easier.

SkeletonWizard wrote:

Thanks! So I add a sprite that will be in the map as an enemy, & judging by the distance from the player I switch out the sprite!

Also, I hate Fortnite
i hate it to
098765432154321
Scratcher
500+ posts

How to add stuff in a sprite-based raycaster?

Ender_bro_06 wrote:

.
What?

Highlight something and press Shift+Down to scroll through my signature!
Did I solve your problem? You can support me here at any time here!


Profile | Scratch Wiki Page

Post Goal: 750 | Posts: 620 (130 left) | Progress: 82.6%
Keep in mind that this doesn't update automatically, so it may be a bit off.

Last Update: 2/16/22
NINJESUS
Scratcher
22 posts

How to add stuff in a sprite-based raycaster?

Codeboy200000
Scratcher
10 posts

How to add stuff in a sprite-based raycaster?

Is there any way to render 3d objects such as a cube or something a little more complex, such as a monitor?

Last edited by Codeboy200000 (Feb. 1, 2023 13:59:40)


This is NOT my signature. The text below this is.



OMG THE BACKROOMS in Scratch??????
WHAAAAAAAAA???????????????????

when I receive [Scratch opened v]
repeat until <New Idea>
broadcast [Think v]
end
go to [Editor v]
forever
try to make (insane) projects
get stuck lol




If u found this, ur smart.
have a cookie

comment on my game, (linked above)if you found the cookie
Undertale for life. Prove me wrong
DeveloperTools
Scratcher
100+ posts

How to add stuff in a sprite-based raycaster?

Codeboy200000 wrote:

Is there any way to render 3d objects such as a cube or something a little more complex, such as a monitor?
Please do not necropost. Necroposting is when you post on an old, closed topic. This post is from 4 years ago. Instead, You should make your own topic.

This is my signature. It appears under every post I make!
Most of the time I'm on here is during school so i might not reply very quickly/not be able to see most images

I'm sorry if anything I say comes off as rude, I don't intend it in a rude way but sometimes im bad with words

Powered by DjangoBB