It is currently Thu Nov 15, 2018 12:17 pm

 All times are UTC - 7 hours

 Page 1 of 1 [ 3 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: 关于碰撞检测/About collision detectionPosted: Fri Jan 18, 2013 7:21 pm

Joined: Sun Jan 06, 2013 7:08 am
Posts: 4

\$13 \$0F (Xp,Yp)

xx_on()

=========================

//==================
if(Xp==0 && Yp!=0){
if(Yp>8){
}
if(Yp<8){
}
}
if(Xp!=0 && Yp==0){
if(Xp>8){
}
if(Xp<8){
}
}
}
//================
//===================
Up_on(){
if(Yp==\$07){
Yp=\$00;
Sy--;
return;
}
if(Xp==0 && Yp==0){
Yp++;
Sy--;
return;
}else{
return;
}
}
if(Xp==0 && Yp!=0){
Yp++;
Sy--;
return;
}
if(Xp!=0 && Yp==0){
Yp++;
Sy--;
return;
}else{
return;
}
}else{
return;
}
}
if(Xp!=0 && Yp!=0){
Yp++;
Sy--;
return;
}
}
//===================
//====================
Down_on(){
if(Yp==\$F9){
Yp=\$00;
Sy++;
return;
}
if(Xp==0 && Yp==0){
Yp--;
Sy++;
return;
}else{
return;
}
}
if(Xp==0 && Yp!=0){
Yp--;
Sy++;
return;
}
if(Xp!=0 && Yp==0){
Yp--;
Sy++;
return;
}else{
return;
}
}else{
return;
}
}
if(Xp!=0 && Yp!=0){
Yp--;
Sy++;
return;
}
}
//======================
//======================
Left_on(){
(Xp==\$07){
Xp=\$00;
Sx--;
return;
}
if(Xp==0 && Yp==0){
Xp++;
Sx--;
return;
}else{
return;
}
}
if(Xp!=0 && Yp==0){
Xp++;
Sx--;
return;
}
if(Xp==0 && Yp!=0){
Xp++;
Sx--;
return;
}else{
return;
}
}else{
return;
}
}
if(Xp!=0 && Yp!=0){
Xp++;
Sx--;
return;
}
}
//======================
//======================
Right_on(){
(Xp==\$F9){
Xp=\$00;
Sx++;
return;
}
if(Xp==0 && Yp==0){
Xp--;
Sx++;
return;
}else{
return;
}
}
if(Xp!=0 && Yp==0){
Xp--;
Sx++;
return;
}
if(Xp==0 && Yp!=0){
Xp--;
Sx++;
return;
}else{
return;
}
}else{
return;
}
}
if(Xp!=0 && Yp!=0){
Xp--;
Sx++;
return;
}
}
//======================

Top

 Post subject: Re: 关于碰撞检测/About collision detectionPosted: Fri Jan 18, 2013 9:10 pm

Joined: Sun Jan 06, 2013 7:08 am
Posts: 4

Top

 Post subject: Re: 关于碰撞检测/About collision detectionPosted: Sat Jan 19, 2013 11:42 pm

Joined: Sun Jan 06, 2013 7:08 am
Posts: 4

Xp==0&&Yp!=0{向垂直方向移动是向占1tile的状态变化，无需碰撞检测；向水平方向移动时将会触发碰撞检测}
Xp!=0&&Yp==0{向水平方向移动是向占1tile的状态变化，无需碰撞检测；向垂直方向移动时将会触发碰撞检测}

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 3 posts ]

 All times are UTC - 7 hours

#### Who is online

Users browsing this forum: No registered users and 2 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ NES / Famicom    NESdev    NESemdev    NES Graphics    NES Music    Homebrew Projects       2018 NESdev Competition       2017 NESdev Competition       2016 NESdev Competition       2014 NESdev Competition       2011 NESdev Competition    Newbie Help Center    NES Hardware and Flash Equipment       Reproduction    NESdev International       FCdev       NESdev China       NESdev Middle East Other    General Stuff    Membler Industries    Other Retro Dev       SNESdev       GBDev    Test Forum Site Issues    phpBB Issues    Web Issues    nesdevWiki