Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C 

Maze Project in C

Hi guys i have a school project to do in Code blocks, more precisely in C Language! Have u some base structure, that u can give me!
requirement: moving the object whit the keys : WASD;
when the object goes against a wall, the player lose;


Thank you
Considering you said school I'm assuming you know if branching, loops and functions.

You will need:
- generating function that will create random maze or hardcode one yourself. I'm not sure how complex creating maze is so if you're allowed to just use bunch of '|' and '-' to create basic structure.
-drawing function that will show current position
-movement and collision logic functions
-infinite loop that reads key input and calls other functions.

i'm asking for help because i didn't learn anything in school, so, yeah i know what you are talking about, but i dont no how to do it


U have discord or something like that ?
To read keys take a look at this:
man getch
For the drawing function:
Make an array or something like that, fill it with you maze + the pointer to show the player position (use write() or printf() or whatever to print)
For the collision:
Really ? It's just a condition

PM if you need some help.
How about using opengl for creating a maze game? I smiply see no benefit in trying to use bunch of if statements and loops for it. And I mean benefits in you actually learning all of that shit instead of spagetti code.
Thank you for all! Is already done


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by xZalurexMay 29, 2021 05:24 PM 2 148 May 29, 2021 05:24 PM
Last Post: xZalurex
[.NET] by H4x10rOct 23, 2019 11:33 PM 4 324 Oct 23, 2019 11:33 PM
Last Post: H4x10r
[C] by IrritiableMay 8, 2019 10:56 AM 6 550 May 8, 2019 10:56 AM
Last Post: MaximumPain