dev.gamez.lv Forum Index dev.gamez.lv
Latvian Game Developers Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 

need tutorialz
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
dev.gamez.lv Forum Index -> Iesācējiem
View previous topic :: View next topic  
Author Message
coderpp



Joined: 20 Aug 2005
Posts: 167
Location: Rīga, Koknese, Gajiena

PostPosted: Wed Aug 29, 2007 11:17 am    Post subject:

snake5 wrote:
un kā es tajā LoadRoomFromFile varēšu ielikt objektus iekšā?

Sarakstīsi savā room faila, visu, kam tur vājbūt, tad nolasi to failu un pēc nolasītās informācijas veido tos objektus, kas tev ir vajadzīgi.
Back to top
View user's profile Send e-mail
snake5
Indago dalībnieks
Indago dalībnieks


Joined: 27 Jun 2007
Posts: 2590

PostPosted: Wed Aug 29, 2007 11:33 am    Post subject:

pagaidām man ir tikai SolidBlock objekts un Player objekts uztaisīti! tad sākšu ar tiem..
_________________
"There are two choices here: "looks good" and "realism"." -- Paul Nettle
Back to top
View user's profile Visit poster's website
snake5
Indago dalībnieks
Indago dalībnieks


Joined: 27 Jun 2007
Posts: 2590

PostPosted: Wed Aug 29, 2007 12:09 pm    Post subject:

labi, viss varētu strādāt, ja vien... man nebūtu maza kļūda kodā:
Code:

bool RoomLoadFromFile(const char* File)
{
   char fBuff;
   FILE* TheRoom = fopen(File,"r");
   if (TheRoom == NULL){return false;}
   SBBS = new SBoundingBoxSys(50);
   while(feof(TheRoom) == 0)
   {
      fBuff = getc(TheRoom);
      switch (fBuff)
      {
      case 'p':
         {
            int xps = fscanf(TheRoom,"%d");
            int yps = fscanf(TheRoom,"%d");
            int dr = fscanf(TheRoom,"%d");
            Player* MAINPLAYER;
            MAINPLAYER = new Player(xps,yps,dr,SBBS);
            PP = MAINPLAYER;
            break;
         }
      case 's':
         {
            RECT tempRect;
            tempRect.left = fscanf(TheRoom,"d");
            tempRect.top = fscanf(TheRoom,"d");
            tempRect.right = fscanf(TheRoom,"d");
            tempRect.bottom = fscanf(TheRoom,"d");
            SBBS->AddBBox(tempRect);
            break;
         }
      default:
         break;
      }
   }
   return true;
}

bet kļūda ir dīvaina - itkā nevar ierakstīt "xps" mainīgajā...
_________________
"There are two choices here: "looks good" and "realism"." -- Paul Nettle
Back to top
View user's profile Visit poster's website
coderpp



Joined: 20 Aug 2005
Posts: 167
Location: Rīga, Koknese, Gajiena

PostPosted: Wed Aug 29, 2007 12:15 pm    Post subject:

A nebij jaraksta tā:
Code:

int xps;
fscanf(TheRoom, "%d", &xps);
Back to top
View user's profile Send e-mail
snake5
Indago dalībnieks
Indago dalībnieks


Joined: 27 Jun 2007
Posts: 2590

PostPosted: Wed Aug 29, 2007 12:17 pm    Post subject:

jā, bija gan, tikko tutoriālī skatījos.. my bad Embarassed
_________________
"There are two choices here: "looks good" and "realism"." -- Paul Nettle
Back to top
View user's profile Visit poster's website
snake5
Indago dalībnieks
Indago dalībnieks


Joined: 27 Jun 2007
Posts: 2590

PostPosted: Wed Aug 29, 2007 12:29 pm    Post subject:

WOOHOO!! pabeidzu - var redzēt te + pamēģināt palabot xr.rmm failu!
DL HERE: http://www.box.net/shared/j5q7c0j2nq
btw: nezkāpēc nezīmējas visi bboxi... mēģināšu salabot..
EDIT: salaboju, drīz updeitošu veco linku
_________________
"There are two choices here: "looks good" and "realism"." -- Paul Nettle
Back to top
View user's profile Visit poster's website
Inf3rnal



Joined: 15 Jun 2006
Posts: 118
Location: Neverland

PostPosted: Wed Aug 29, 2007 2:38 pm    Post subject:

Jau ir kkas vairāk Smile mb atstaj vairāk vietas pa kuru paskraidīt un pavidu arī kadu kluci noliec Wink
Back to top
View user's profile Send e-mail
snake5
Indago dalībnieks
Indago dalībnieks


Joined: 27 Jun 2007
Posts: 2590

PostPosted: Wed Aug 29, 2007 3:26 pm    Post subject:

bet to taču tu vari arī pats izdarīt! Wink room's lādējas no "xr.rmm" faila!
btw, lai izgludinātu sadursmes, man vajadzēs uzzināt, kā atrast virzienu no pirmā punkta uz otro, jeb, kā atrast virzienu no vektora! kāds var pateikt?
šajā gadījumā virziens ir vektors!
_________________
"There are two choices here: "looks good" and "realism"." -- Paul Nettle
Back to top
View user's profile Visit poster's website
Inf3rnal



Joined: 15 Jun 2006
Posts: 118
Location: Neverland

PostPosted: Wed Aug 29, 2007 5:00 pm    Post subject:

Kas vainas sadursmēm? Man likās ka viss ir ok.
Back to top
View user's profile Send e-mail
snake5
Indago dalībnieks
Indago dalībnieks


Joined: 27 Jun 2007
Posts: 2590

PostPosted: Wed Aug 29, 2007 5:21 pm    Post subject:

es varētu uztaisīt tā, ka malā slīpi ieskrienot, spēlētājs neapstātos, man tikai jāzina, kā dabūt leņķi no vektora! kāpēc? tāpēc, ka es biju strādājis ar gamemaker un tur bija funkcija, kura izrēķina leņķi no vektora, tāpēc man nav bijis vajadzības to zināt!
_________________
"There are two choices here: "looks good" and "realism"." -- Paul Nettle
Back to top
View user's profile Visit poster's website
Inf3rnal



Joined: 15 Jun 2006
Posts: 118
Location: Neverland

PostPosted: Wed Aug 29, 2007 5:33 pm    Post subject:

Nu jā, berzties gar malu ir jautrāk nekā tajā vienk spūst Smile
Back to top
View user's profile Send e-mail
snake5
Indago dalībnieks
Indago dalībnieks


Joined: 27 Jun 2007
Posts: 2590

PostPosted: Wed Aug 29, 2007 5:53 pm    Post subject:

nu, katrā ziņā šodien vairs neko nedarīšu... kautkā nav vēlēšanās tagad...
_________________
"There are two choices here: "looks good" and "realism"." -- Paul Nettle
Back to top
View user's profile Visit poster's website
coderpp



Joined: 20 Aug 2005
Posts: 167
Location: Rīga, Koknese, Gajiena

PostPosted: Wed Aug 29, 2007 6:04 pm    Post subject:

Manuprāt, lai dabūtu leņķi, tev vajadzēs divus vektorus.
Palasi šeit: Kaut kas par vektoriem
Vēl mācies izmantot googli, jo dažreiz tur atbildi var atrast daudzreiz atrāk, nekā sagaidīt to forumā. Wink
Back to top
View user's profile Send e-mail
snake5
Indago dalībnieks
Indago dalībnieks


Joined: 27 Jun 2007
Posts: 2590

PostPosted: Wed Aug 29, 2007 8:16 pm    Post subject:

šeit es jau iepriekš biju, bet vēl neesmu notestējis to, ko izveidoju, šodien neko negribas darīt.. par pirmo vektoru es paņēmu 1,0 un par otro -- x2-x1,y2-y1 -- rīt varbūt paskatīšos, vai tā strādā, vai virziens jāpārveido..
_________________
"There are two choices here: "looks good" and "realism"." -- Paul Nettle
Back to top
View user's profile Visit poster's website
bubu
Indago Uzvarētājs
Indago Uzvarētājs


Joined: 23 Mar 2004
Posts: 3223
Location: Riga

PostPosted: Wed Aug 29, 2007 9:44 pm    Post subject:

brr... FILE*, fopen, feof, getc, fscanf... Kāpēc tu, snake5, programmē C, ja jau gribi programmēt C++? Un kur ir fclose?
Back to top
View user's profile Send e-mail
Display posts from previous:   
dev.gamez.lv Forum Index -> Iesācējiem All times are GMT + 2 Hours
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 4 of 6

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group