プレイ日記
BoogerFace BlueDog100
can someone plz tell me how to raycast plz? I'm such a terrible programer & I want to at least know how to make a first-person-view game where you just walk around in a small cave...PLZ HELP. :(:(:( I'll follow you :)
4そうだね
プレイ済み
返信[1]
親投稿
BoogerFace BlueDog100
(weakly) anyone...:_(
0そうだね
プレイ済み
返信[2]
親投稿
Zee Storybookten9
It's kind of complex. Raycasting (in this context) is the art of finding defined blocks by shooting rays out and seeing if they hit anything. Thus, basic trigonometry, good knowledge of BASIC, and time to make maps is required. Do you have these three?
0そうだね
プレイ済み
返信[3]
親投稿
Stewart segludian
You may want to go look up ti85calc's spooky maze on smilebasicsource. If I remember the game has a raycasting library. But basically you would have a map array with block codes. you would also have an x, y position and rotation of the character, and a way to map that to your block array. Using trig send out virtual rays from angle - field of view to angle plus field of view. You find intersecting
1そうだね
プレイ済み
返信[4]
親投稿
Stewart segludian
for each ray find the closest intersecting solid block, and what pixel column it intersect's with. then draw the column of pixels for that block scaled bigger or smaller based on distance. For now just colo the ceiling and floor a solid color. All this gets slow very quickly. I am sure there are plenty of c code tutorials around the internet. May be old dos code, beware.
1そうだね
プレイ済み