You are not logged in.
Lost Password?


Register To Post



 Bottom   Previous Topic   Next Topic

#21
Re: GoSub 2
Posted on: 2010/7/16 16:07
VUE(xpert)
Joined 2003/9/3
Sweden
442 Posts
PVBCC EntryHighscore Top10 3rdCoderContributorHOTY09 2ndLong Time User (15 Years) DonatorApp CoderPVBCC 2010 1st20+ Game RatingsPVBCC 2013 2nd
I don't have exactly those, but one nice feature with mednafen (that Reality Boy doesn't have) is that you can tweak the exact hues of red/blue RGB colors through the config file to match your glasses. Did you try that? It works pretty well for me.
Top

#22
Re: GoSub 2
Posted on: 2010/7/16 21:07
Administrator
Joined 2000/1/8
Germany
2544 Posts
Highscore Top10Highscore Top ScoreCoder#1 PosterHOTY09 1stLong Time User (15 Years) App Coder90+ Game Ratings
Oh, didn't know that, what a nice feature! I will try it out some day.
Top

#23
Re: GoSub 2
Posted on: 2010/7/16 22:34

Joined 2010/2/15
Netherlands
-1 Posts
Long Time User (10 Years)
Oh wow, those glasses look so much more awesome and durable than those standard issue cardboard ones I have. I bought 'em too.

Changing the color scheme can be done on the command line too, by the way. It's all explained in the Mednafen thread on here somewhere.
Top

#24
Re: GoSub 2
Posted on: 2010/7/17 0:19

Joined 2008/4/26
USA
-1 Posts
CoderContributorTop10 PosterHOTY09 3rdLong Time User (12 Years) PVBCC 2010 EntryPVBCC 2013 Entry
I've been trying to make the game be in 3D but I am having some troubles. It doesn't matter when the ship is in the foreground or the background, it still hits the first foreground bar. (When the sub is in the background, it shouldn't hit the foreground bar because it's not in the sub's dimension) I think it has something to do with lines 34-37, but I am not sure. I have moved the background maze to world 2 so this has removed the underwater background in favor of an actual 3D game. So if someone could look through my code and tell me what I'm doing wrong with the collision detection, I'd very much appreciate it.

Attach file:


c g2.c Size: 11.65 KB; Hits: 182
vb g2.VB Size: 256.00 KB; Hits: 185
Top

#25
Re: GoSub 2
Posted on: 2010/7/17 2:05
VUE(xpert)
Joined 2003/9/3
Sweden
442 Posts
PVBCC EntryHighscore Top10 3rdCoderContributorHOTY09 2ndLong Time User (15 Years) DonatorApp CoderPVBCC 2010 1st20+ Game RatingsPVBCC 2013 2nd
Here's your problem:

Change

HWORD getBGMapChar
(bgmapxy)

    return (
BGMM[(0x1000) + (64) + x]&0x7FF);  
}


to

HWORD getBGMapChar
(bgmapxy)

    return (
BGMM[bgmap*(0x1000) + (64) + x]&0x7FF);  
}
Top

#26
Re: GoSub 2
Posted on: 2010/7/17 2:56

Joined 2008/4/26
USA
-1 Posts
CoderContributorTop10 PosterHOTY09 3rdLong Time User (12 Years) PVBCC 2010 EntryPVBCC 2013 Entry
That worked for the foreground, but now the background level has no collision detection.
Top

#27
Re: GoSub 2
Posted on: 2010/7/17 2:56
VUE(xpert)
Joined 2003/9/3
Sweden
442 Posts
PVBCC EntryHighscore Top10 3rdCoderContributorHOTY09 2ndLong Time User (15 Years) DonatorApp CoderPVBCC 2010 1st20+ Game RatingsPVBCC 2013 2nd
Now, I know you've been picked on before for your coding style, but your code is still very hard to read (and thus it will take longer for us to help you find errors in it).

The worst thing is that you tend to repeat the same code over and over again, which is both redundant and inefficient.

For example, stuff like this:

// bottom front
if ((d==0) && (getBGMapChar(1, (xpos/8)+0, (ypos/8)+2)==512)) xpos=20ypos=180gamesubdir=0lives=lives-1b=1torpedodir=0;
if ((
d==0) && (getBGMapChar(1, (xpos/8)+1, (ypos/8)+2)==512)) xpos=20ypos=180gamesubdir=0lives=lives-1b=1torpedodir=0;
if ((
d==0) && (getBGMapChar(1, (xpos/8)+2, (ypos/8)+2)==512)) xpos=20ypos=180gamesubdir=0lives=lives-1b=1torpedodir=0;
if ((
d==0) && (getBGMapChar(1, (xpos/8)+3, (ypos/8)+2)==512)) xpos=20ypos=180gamesubdir=0lives=lives-1b=1torpedodir=0;
if ((
d==0) && (getBGMapChar(1, (xpos/8)+4, (ypos/8)+2)==512)) xpos=20ypos=180gamesubdir=0lives=lives-1b=1torpedodir=0;


is a big no-no and should instead be written like:

// bottom front
if (== 0) { 
  
int i;
  for (
05i++) {
    if(
getBGMapChar(1, (xpos/8)+i, (ypos/8)+2) == 512) {
      
xpos 20;
      
ypos 180;
      
gamesubdir 0;
      
lives--;
      
1;
      
torpedodir 0;
      break;
    }
  }
}


which does the exact same thing but is alot cleaner to read. (And also faster for the poor VB to execute)

Please try to make changes like that
Top

#28
Re: GoSub 2
Posted on: 2010/7/17 3:01

Joined 2008/4/26
USA
-1 Posts
CoderContributorTop10 PosterHOTY09 3rdLong Time User (12 Years) PVBCC 2010 EntryPVBCC 2013 Entry
The difference between the my example and yours is I understand mine. Of course, I am still learning C, and why I code the way I do is because I have a lot more experience in Basic than I do in C. But yeah, I will do my best to try and clean up the code to the best of my abilities with what knowledge of C (which is little) I know.
Top

#29
Re: GoSub 2
Posted on: 2010/7/17 3:37
VUE(xpert)
Joined 2003/9/3
Sweden
442 Posts
PVBCC EntryHighscore Top10 3rdCoderContributorHOTY09 2ndLong Time User (15 Years) DonatorApp CoderPVBCC 2010 1st20+ Game RatingsPVBCC 2013 2nd
Quote:

VirtualChris wrote:
That worked for the foreground, but now the background level has no collision detection.


I see it now...
It's because you're using a different coral char for the background than the foreground (different charsegs containing identical graphics = waste!).

Fix it by either have both bgmap1 and bgmap2 use the same charseg (preferred, since it's really the same graphic anyway), OR check for collision with char 1024 instead of 512 when the sub is in the background level.
Top

#30
Re: GoSub 2
Posted on: 2010/7/17 4:05

Joined 2008/4/26
USA
-1 Posts
CoderContributorTop10 PosterHOTY09 3rdLong Time User (12 Years) PVBCC 2010 EntryPVBCC 2013 Entry
I now have a new problem: The sub won't move. Before you groan because you have to look through my code, I'll remind you I tried to fix it up as best I could. If it's not enough and I need to do it some more, I apologize.

Attach file:


c g2.c Size: 7.88 KB; Hits: 175
Top

 Top   Previous Topic   Next Topic


Register To Post