Posts tagged ‘ncurses’

14 Day Rouge-like – Day II

Today I played around with rewriting everything from scratch in C++. It ended up being object oriented but a pain to use, so I went back to my C implementation. The map system I reimplemented in layers ( a wall layer and a floor layer right now). Trouble is, it still doesn’t detect collisions. I found out that my problem was lack of planning. My player_x and player_y variables use NCurses-relative coordinates, whereas the wall[y][x] is map-relative.  So now I will rewrite that one more time and get it working. If I have too much more trouble I may try using LISP despite having 2 days less and being somewhat unfamiliar with the language.

14-day Rougelike – Day I

This morning I was surfing around and stumbled across references to a mysterious 7DRL. After more research I discovered that this was an acronym for 7-day-rougelike. Where a person works on a rougelike for 7 days and then stops development. Entirely. Permanently. Thinking this was an interesting idea, I decided to have a go at a 14DRL, since this will be my first rougelike and first time using curses/ncurses for anything but tests.

I’m writing it in C using NCurses mainly as an exercise to keep my C skills (which have fallen into disusage) up as well as to learn the NCurses library better. The fact that it’s enjoyable helps too. So…today I got it to Display the map, display the player, move the player, display messages, and show stats. I am, however having trouble with collision detection. How do I get the contents of a cell in ncurses? Googling turned up nothing (well, lots of python). Should I just create an array on map generation containing all impassable cells and check that whenever the player moves? Anyway, I’ll put up sourcecode soon.