Hey guys!!!!!
It was a very great to see you in classroom. I and my project mate (Sheeraz Ahmed) really enjoyed it by presenting on Console Graphics. So far, if you have any type of question, even not from Console Graphics, you can post a comment on this..... We will give you the answers....Regards,
Wajahat Karim
Sheeraz Ahmed
Authors, Dreamers Are Developers
sir
ReplyDeletehow i can move cursor in XP direction and after that in YN direction
in simple animation
i tried but i was not able to move in both in one console
dear abdul rehman!
ReplyDeleteyou can do that. theree is no problem in it.... just see code from simple animation code and i will tell you how to do it......
here is simple code for xp motion...
for (cx; !kbhit(); cx++) {
if (cx >= 70) {
cx=0;
}
gotoxy(cx,cy);
cout<<snake;
Sleep(10);
clrscr();
}
Regards,
Wajahat Karim
Author, Dreamers Are Developers
so you will see that cx is increasing in loop. so square is printing every time on new coordinate... so if you want to move in both directions then you have to increase cy as well.... that is concept... so here i show u the code...
ReplyDeletefor (cx, cy; !kbhit(); cx++, cy++) {
if (cx >= 70) {
cx=0;
}
if (cy >= 17) {
cy = 0;
}
gotoxy(cx,cy);
cout<<snake;
Sleep(10);
clrscr();
}
i hope you have got it..... try it.... :)
Regards,
Wajahat Karim
Author, Dreamers Are Developers