Jump to content
  • Advertisement
Sign in to follow this  
red-dragonX

cursess/ncurses problem--looking for a function that deletes a character...

This topic is 4942 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

ok, well i'm having this problem. i'm using curses, not ncurses (i don't have much experience in this, but i think ncurses is an update version of curses? or adds a few more things to the library). anyways, so yeah, i'm stuck with curses library. here's the code that i have down: if ((sx == tx) && (sy == ty)) // mvdelch(ty, tx); mvwdelch(WINDOW* win, ty, tx); //upon collision of the two characters, I want one of them to //just disapper... i.e. killing off an enemy and making him //disappear first, i used mvdelch...it didn't work correctly. when the two characters had the same coords, they both just kept moving. so i decided to test with the mvwdelch function... (plus, i noticed the WINDOW* win in the beginning of code and thought this function may be the one to use). so i did.... only it won't compile.... (ignore the warnings, they've been there) : /usr/include/widec.h:41: warning: `putwchar' redefined /usr/include/iso/wchar_iso.h:341: warning: this is the location of the previous definition project4.c: In function `main': project4.c:179: parse error before `WINDOW' *** Error code 1 make: Fatal error: Command failed for target `project4' yet, if i replace it with mvdelch, it compiles, so it has something to do with mvwdelch. plus, i noticed that delch itself compiled whereas wdelch(WINDOW* win) didn't either (with the same parse errors). any clues? are the wdelch and mvwdelch functions for ncurses only? am i not giving the right arguments? any help is appreciated... thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by red-dragonX
if ((sx == tx) && (sy == ty))
// mvdelch(ty, tx);
mvwdelch(WINDOW* win, ty, tx);

am i not giving the right arguments?


Never include the variable's type ("WINDOW *" here) when making a function call.

Share this post


Link to post
Share on other sites
thanks Zahlman. I can get it to compile, but it's not working. if i'm correct, you send in mvwdelch(win, y, x), so in my case, i send in the enemy's points.. i.e.
mvwdelch(win, enemies[1].y, enemies[1].x);

with that call, would it not 'delete' the X that is represented by the enemies[1].x and enemies[1].y coordinates?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!