You are not logged in.
Lost Password?


Register To Post



 Bottom   Previous Topic   Next Topic

#31
Re: CAPITAN SEVILLA II GAME
Posted on: 2010/11/4 1:14
PVB Elite
Joined 2003/7/26
USA
1469 Posts
PVBCC EntryCoderContributorSpecial AchievementTop10 PosterHOTY09 EntryLong Time User (15 Years) App Coder20+ Game RatingsPVBCC 2013 Entry
Quote:

rubengar wrote:
I see C tutorials but did not find an answer for blink font o blink character, I would be very grateful if you help me!! Capitan sevilla go on!!:)


Well, obviously, to make something blink, you just make it invisible periodically. It's essentially the same as the animation you've already done, you just change the visibility of the "thing" instead of changing the picture.

Each Object and each World has a "visibility" bit for each screen. If you toggle these bits in sync with the screen refresh rate, the item in question will blink. If you just want a specific character (or "cell") in a BGMap to blink, you'll have to actually change the character pointed to by that cell (again, just like animation). If you want every instance of a given character to blink, you can actually change the pixels in it every frame. I would suggest keeping the two (or more) "versions" of the char and using copymem() (with alternating source pointers) to do the changing.

The main problem (which I think is also the problem with your/my/our jump code) is the "synchronizing to the screen refresh" part. vbWaitFrame() (no matter which version you have) is just not the answer for "production-quality" code. I've experimented with using the VIP interrupt and the "display" and "expansion" status registers, but the docs are quite confusing in this area (at least to me). The timer is also a possibility (see Fwirt's demo code).
Top

#32
Re: CAPITAN SEVILLA II GAME
Posted on: 2010/11/4 2:12
Nintendoid!
Joined 2007/8/8
Great Britain
201 Posts
CoderContributorHOTY09 EntryLong Time User (12 Years) App Coder
rubengar, if you upload your graphics, I'll look at getting your project working with grit. It'd mean you'd be able to have all your graphics in a single file.
Top

#33
Re: CAPITAN SEVILLA II GAME
Posted on: 2010/11/4 2:20
VUE(xpert)
Joined 2006/9/29
USA
267 Posts
CoderLong Time User (13 Years) PVBCC 2010 3rd
Quote:

RunnerPack wrote:
I've experimented with using the VIP interrupt and the "display" and "expansion" status registers, but the docs are quite confusing in this area (at least to me).

No kidding... The official Nintendo development manual talks about game frame timing in section 5-21-1. Apparently they intended you to use the refresh rate as the timer for your main loop, although I haven't really had the time to get that figured out. However, the timer is pretty easy to understand and set to the correct speed for your game. Basically what I'm doing for main loop timing right now is setting up the timer before I get into the main loop, and then waiting for zero status every time I finish one iteration of my main loop. Something like this:

timer_freq
(TIMER_100US);
timer_set(TIME_MS(15));
timer_enable(1);
for(;;) {
    
timer_clearstat();

    
// Insert main routine here

    
while(!timer_getstat());
}

Note that I use getstat differently, as I modified my version of libgccvb to be more true to the hardware so that getstat returns 1 when the timer is 0. The timer takes a few more instructions to set up, but it will make your program a lot more reliable.
Top

#34
Re: CAPITAN SEVILLA II GAME
Posted on: 2010/11/5 23:35
Nintendoid!
Joined 2007/8/8
Great Britain
201 Posts
CoderContributorHOTY09 EntryLong Time User (12 Years) App Coder
Flicker / display sync mini-demo:


int main
()
{
  
int count0;

  
vbDisplayOn();
  
vbDisplayShow();

  
// main loop @ 50 Hz
  
while(1)
  {
    
// wait for the VIP to finish drawing
    
while(!(VIP_REGS[REG_INTPND] & XPEND));
    
// clear flag
    
VIP_REGS[INTCLR]= XPEND;

    
// read controller

    // do stuff        

    
if((count%7)==0)
      
VIP_REGS[BKCOL] ^= 3;  // flicker

    
count++;
  }

  return 
0;
}
Top

#35
Re: CAPITAN SEVILLA II GAME
Posted on: 2010/11/6 0:50
Nintendoid!
Joined 2007/8/8
Great Britain
201 Posts
CoderContributorHOTY09 EntryLong Time User (12 Years) App Coder
Oops, fixed a typo:


if((count&7)==0)
      
VIP_REGS[BKCOL] ^= 3;  // flicker
Top

#36
Re: CAPITAN SEVILLA II GAME
Posted on: 2010/11/6 10:12
Virtual Freak
Joined 2008/5/30
Spain
78 Posts
CoderLong Time User (12 Years) PVBCC 2010 2nd
thank you all for your answers!!! new demo coming soon!!
Top

#37
Re: CAPITAN SEVILLA II GAME
Posted on: 2010/11/7 23:51
Virtual Freak
Joined 2008/5/30
Spain
78 Posts
CoderLong Time User (12 Years) PVBCC 2010 2nd
The captain sevilla continues forward, now it can shoot "morcillas radiactivas" to kill the enemies, and I have included a game over text when you die and a screen of introduction initially of level, and new enemies. I want to continue working with the new backgrounds before upload a new demo!!

Open in new window

Open in new window

Open in new window
Edited by rubengar on 2010/11/8 0:02
Edited by rubengar on 2010/11/8 0:06
Top

#38
Re: CAPITAN SEVILLA II GAME
Posted on: 2010/11/17 16:32
Virtual Freak
Joined 2008/5/30
Spain
78 Posts
CoderLong Time User (12 Years) PVBCC 2010 2nd
Hello! I leave here a demo of the game in its current state, I work much still. The demo works ok in the mednafen and reality boy emulator, in the red dragon WORKS BAD!! Thanks!!


CONTROLS:

lef pad= move the character
A button= shoot "morcillas radiactivas"
B button= jump power "press more time the button to jump more"
start button= pause game

ICON:

take a "morcilla radiactiva" blink= one "morcilla" plus

Attach file:


vb capitan.VB Size: 512.00 KB; Hits: 197
Top

#39
Re: CAPITAN SEVILLA II GAME
Posted on: 2010/11/17 21:22
PVB Elite
Joined 2003/7/26
USA
1469 Posts
PVBCC EntryCoderContributorSpecial AchievementTop10 PosterHOTY09 EntryLong Time User (15 Years) App Coder20+ Game RatingsPVBCC 2013 Entry
Quote:

rubengar wrote:
...
A button= shoot "morcillas radiactivas"
B button= jump power "press more time the button to jump more"
...


I think you got those swapped as "A" is the jump and "B" is "throw" (which is the "correct" way to do it ).

The progress is definitely going well, but I would really like to look at the code so I can help fix the "moving forward aborts the jump" bug. It's probably a side-effect of putting in tests for other buttons besides "A".

I'm proud of you! Keep up the good work!
Top

#40
Re: CAPITAN SEVILLA II GAME
Posted on: 2010/11/17 21:36
Virtual Freak
Joined 2008/5/30
Spain
78 Posts
CoderLong Time User (12 Years) PVBCC 2010 2nd
Quote:

RunnerPack wrote:
Quote:

rubengar wrote:
...
A button= shoot "morcillas radiactivas"
B button= jump power "press more time the button to jump more"
...


I think you got those swapped as "A" is the jump and "B" is "throw" (which is the "correct" way to do it ).

The progress is definitely going well, but I would really like to look at the code so I can help fix the "moving forward aborts the jump" bug. It's probably a side-effect of putting in tests for other buttons besides "A".

I'm proud of you! Keep up the good work!


jejeje, sorry confused me to write!!

B button= shoot "morcillas radiactivas"
A button= jump power "press more time the button to jump more"
Edited by rubengar on 2010/11/17 22:06
Top

 Top   Previous Topic   Next Topic


Register To Post