Register To Post



 Bottom   Previous Topic   Next Topic

#11
Re: CAPITAN SEVILLA II GAME
Posted on: 2010/10/19 18:06
Virtual Freak
Joined 2008/5/30
Spain
73 Posts
CoderLong Time User (4 Years) PVBCC 2010 2nd
the character movement is OK! One question! when the caracter stop, how to stop always in the first frame of the animation?? and other cuestion because the caracter looks bad to go through the background!!

very very thanks!!!

Attach file:


vb capitan.VB Size: 128.00 KB; Hits: 39
c capitan.c Size: 2.63 KB; Hits: 50
Top

#12
Re: CAPITAN SEVILLA II GAME
Posted on: 2010/10/19 19:14
VUE(xpert)
Joined 2008/12/28
Slovenia
445 Posts
Highscore Top ScoreCoderContributorTop10 Poster10+ Game RatingsLong Time User (4 Years) App CoderPVBCC 2010 Entry
Quote:

rubengar wrote:
One question! when the caracter stop, how to stop always in the first frame of the animation??


Why not just set 'frame' to 0? It controls what frame is displayed, right?

Quote:

and other cuestion because the caracter looks bad to go through the background!!


I might be wrong, but I believe it's because it has black pixels.
Top

#13
Re: CAPITAN SEVILLA II GAME
Posted on: 2010/10/19 19:50
Virtual Freak
Joined 2008/5/30
Spain
73 Posts
CoderLong Time User (4 Years) PVBCC 2010 2nd
"Why not just set 'frame' to 0? It controls what frame is displayed, right?"



set frame to 0 but don´t work for this function



"I might be wrong, but I believe it's because it has black pixels."




other colors are wrong too. In other games the black color can be used as solid colour.

thanks!!
Top

#14
Re: CAPITAN SEVILLA II GAME
Posted on: 2010/10/19 19:57
VUE(xpert)
Joined 2006/9/29
USA
267 Posts
CoderLong Time User (6 Years) PVBCC 2010 3rd
Quote:

HorvatM wrote:
Quote:

rubengar wrote:
and other cuestion because the caracter looks bad to go through the background!!


I might be wrong, but I believe it's because it has black pixels.


Actually, the Virtual Boy is perfectly capable of displaying solid black, but you have to be careful, because there are two different "blacks." If you set one of the pixels in your char to binary 00, that's actually the code for a transparent pixel (but it will look black on a black background.) In order to get true black, you will have to change one of your palettes to include solid black, then set the bgmap to reference that color. For example:

VIP_REGS
[GPLT0] = 0xE0// 0b11100000

will change any cells in your BGMap using palette zero (the default) so that "dark red" (0b01) is now black. Make sure to put that statement after vbDisplayOn() if you want to try it, as vbDisplayOn() resets all palettes to 0xE4 (0b11100100).
Top

#15
Re: CAPITAN SEVILLA II GAME
Posted on: 2010/10/20 2:12
Virtual Freak
Joined 2008/5/30
Spain
73 Posts
CoderLong Time User (4 Years) PVBCC 2010 2nd
Quote:

Fwirt wrote:
Quote:

HorvatM wrote:
Quote:

rubengar wrote:
and other cuestion because the caracter looks bad to go through the background!!


I might be wrong, but I believe it's because it has black pixels.


Actually, the Virtual Boy is perfectly capable of displaying solid black, but you have to be careful, because there are two different "blacks." If you set one of the pixels in your char to binary 00, that's actually the code for a transparent pixel (but it will look black on a black background.) In order to get true black, you will have to change one of your palettes to include solid black, then set the bgmap to reference that color. For example:

VIP_REGS
[GPLT0] = 0xE0// 0b11100000

will change any cells in your BGMap using palette zero (the default) so that "dark red" (0b01) is now black. Make sure to put that statement after vbDisplayOn() if you want to try it, as vbDisplayOn() resets all palettes to 0xE4 (0b11100100).



succes!!! thanks you very much!!

when the caracter stop, how to stop always in the first frame of the animation??

sorry for my questions!!
I´m a graphic designer in reality and your information is of great help to me!!


thanks friends!!

Attach file:


vb capitan.VB Size: 128.00 KB; Hits: 35
Top

#16
Re: CAPITAN SEVILLA II GAME
Posted on: 2010/10/20 7:54
VUE(xpert)
Joined 2006/9/29
USA
267 Posts
CoderLong Time User (6 Years) PVBCC 2010 3rd
Quote:

rubengar wrote:
when the caracter stop, how to stop always in the first frame of the animation??

That really depends on your code. The basic idea is that if the character is not moving, you set the sprite to the first frame. That means you have to keep track of whether the character should be moving, which could be as simple as checking if the player isn't pressing anything. Some pseudocode for that would be:

if (left is pressed)
    
move left
    update animation
else if (right is pressed)
    
move right
    update animation
.... // More ifs
else if (nothing is pressed)
    
change the frame to the first one

...And then update the images onscreen. To be more efficient, you could even put the nothing pressed case at the top, and then your code wouldn't have to check for any of the other cases. There are more complicated ways of doing this, but this simple way might work for you.
Top

#17
Re: CAPITAN SEVILLA II GAME
Posted on: 2010/10/20 11:46
Virtual Freak
Joined 2008/5/30
Spain
73 Posts
CoderLong Time User (4 Years) PVBCC 2010 2nd
Quote:

Fwirt wrote:
Quote:

rubengar wrote:
when the caracter stop, how to stop always in the first frame of the animation??

That really depends on your code. The basic idea is that if the character is not moving, you set the sprite to the first frame. That means you have to keep track of whether the character should be moving, which could be as simple as checking if the player isn't pressing anything. Some pseudocode for that would be:

if (left is pressed)
    
move left
    update animation
else if (right is pressed)
    
move right
    update animation
.... // More ifs
else if (nothing is pressed)
    
change the frame to the first one

...And then update the images onscreen. To be more efficient, you could even put the nothing pressed case at the top, and then your code wouldn't have to check for any of the other cases. There are more complicated ways of doing this, but this simple way might work for you.






Succes!!! thanks friend!!! You are a big help for my!! I will send a "Jamón de pata negra" jejeje

Attach file:


vb capitan.VB Size: 128.00 KB; Hits: 35
Top

#18
Re: CAPITAN SEVILLA II GAME
Posted on: 2010/10/22 11:54
Virtual Freak
Joined 2008/5/30
Spain
73 Posts
CoderLong Time User (4 Years) PVBCC 2010 2nd
Hi friends my character´s jump is very ugly!! I need your help to improve. Please you see my code and help me to improve jumping, I don´t mind the animation, only improve movement. I used 3 days and not improving jump, I leave my code! thanks for your time!!

Attach file:


c capitan.c Size: 4.15 KB; Hits: 38
vb capitan.VB Size: 128.00 KB; Hits: 34
Top

#19
Re: CAPITAN SEVILLA II GAME
Posted on: 2010/10/22 20:21
PVB Elite
Joined 2003/7/26
USA
967 Posts
PVBCC EntryCoderContributorSpecial AchievementTop10 PosterHOTY09 EntryLong Time User (9 Years) App Coder20+ Game Ratings
Quote:

rubengar wrote:
Hi friends my character´s jump is very ugly!! I need your help to improve. Please you see my code and help me to improve jumping, I don´t mind the animation, only improve movement. I used 3 days and not improving jump, I leave my code! thanks for your time!!


Hi, rubengar,

I haven't looked at your code (or played your demo, actually...) but I've explained a system for jumping using simulated gravity in some detail in this post. Then I wrote an (untested) implementation and posted it here (BTW, the search function is your friend ).

I hope this helps; this seems like it could end up being a very fun game!

EDIT: I just played it and looked at the code. I can see one major problem with your jumping (he immediately "teleports" to the top of the jump) and a small graphical glitch in the walk-cycle (some pixels from the next frame show up in one of the right-facing images) but it definitely looks good so far. Just try implementing the code I posted above. It can probably be copied/pasted, for the most part.
Top

#20
Re: CAPITAN SEVILLA II GAME
Posted on: 2010/10/22 20:51
Virtual Freak
Joined 2008/5/30
Spain
73 Posts
CoderLong Time User (4 Years) PVBCC 2010 2nd
Quote:

RunnerPack wrote:
Quote:

rubengar wrote:
Hi friends my character´s jump is very ugly!! I need your help to improve. Please you see my code and help me to improve jumping, I don´t mind the animation, only improve movement. I used 3 days and not improving jump, I leave my code! thanks for your time!!


Hi, rubengar,

I haven't looked at your code (or played your demo, actually...) but I've explained a system for jumping using simulated gravity in some detail in this post. Then I wrote an (untested) implementation and posted it here (BTW, the search function is your friend ).

I hope this helps; this seems like it could end up being a very fun game!

EDIT: I just played it and looked at the code. I can see one major problem with your jumping (he immediately "teleports" to the top of the jump) and a small graphical glitch in the walk-cycle (some pixels from the next frame show up in one of the right-facing images) but it definitely looks good so far. Just try implementing the code I posted above. It can probably be copied/pasted, for the most part.






hello, your code I had seen him days ago, but I did not work.
I hope you can help me. you could include in my code your jump code??, maybe something I did wrong
:(
the glitch I'll fix it when the char animation ends!!


thank you very much!!!!
Top

 Top   Previous Topic   Next Topic


Register To Post

You are not logged in.
Lost Password?
Register Resend Activation