Jump to content
IGNORED

Another Noobie Question


ZippyRedPlumber

Recommended Posts

  • 1 month later...
2 hours ago, ZippyRedPlumber said:

1. how do I make 16x32 sprite of the hero?

Use 2 16x16 sprites. 

2 hours ago, ZippyRedPlumber said:

2. Are boss graphics like what's pictured below possible?

No, because black is a color. Only 2 colors only 8x1 a line. You can use ICVGM 3.3.0 http://www.colecovision.dk/tools.htm to make the graphic or Magellan from the TI side have tile editor. CV Sprite 2 from the graphic tool kit is helpful to make and stage your sprites on screen.

Link to comment
Share on other sites

3 hours ago, Kiwi said:

Use 2 16x16 sprites. 

No, because black is a color. Only 2 colors only 8x1 a line. You can use ICVGM 3.3.0 http://www.colecovision.dk/tools.htm to make the graphic or Magellan from the TI side have tile editor. CV Sprite 2 from the graphic tool kit is helpful to make and stage your sprites on screen.

Okay, How do a merge 2 sprites on code, what commands should I use?

Link to comment
Share on other sites

This is how I do it with 2 sprites,

void PlayerPose(){
sprites[0].x=herox;
sprites[0].y=heroy;
sprites[0].pattern=herop;
sprites[0].colour=5;

sprites[1].x=herox;
sprites[1].y=heroy-16;
sprites[1].pattern=herop+4;
sprites[1].colour=5;
}
Noticed that I'm using a variable for the x and y.  See sprites[1].y.  There is "heroy-16", which will be always be above the sprites[0].y by 16 pixels, and pattern is always the next pattern on the table.
sample:
a=1;
enable_nmi(); so sound and controller will work
while(a==1){

delay(1);//must have this in the game loop
updatesprites(0,64);//update sprites, do this here or you'll see tearing if you put this later in the game loop.
PlayerPose();} 

This is how I write this in C. 

  • Like 1
Link to comment
Share on other sites

5 hours ago, Kiwi said:

This is how I do it with 2 sprites,

void PlayerPose(){
sprites[0].x=herox;
sprites[0].y=heroy;
sprites[0].pattern=herop;
sprites[0].colour=5;

sprites[1].x=herox;
sprites[1].y=heroy-16;
sprites[1].pattern=herop+4;
sprites[1].colour=5;
}
Noticed that I'm using a variable for the x and y.  See sprites[1].y.  There is "heroy-16", which will be always be above the sprites[0].y by 16 pixels, and pattern is always the next pattern on the table.
sample:
a=1;
enable_nmi(); so sound and controller will work
while(a==1){

delay(1);//must have this in the game loop
updatesprites(0,64);//update sprites, do this here or you'll see tearing if you put this later in the game loop.
PlayerPose();} 

This is how I write this in C. 

Just what I needed, thanks man. :)

  • Like 1
Link to comment
Share on other sites

  • 3 months later...
#include <coleco.h>
#include <getput1.h>

byte game,robotx,roboty,movedelay;


const byte PATTERN[] = {
  0x89, 0x00, 0x0A, 0x38, 0x5C, 0x7D, 0x7C, 0x38, 0x00, 0x03, 0x07, 0x07, 0x0E, 0x0E, 0x82,
  0x0C, 0x04, 0xC0, 0xE0, 0xE0, 0x70, 0x70, 0x82, 0x30, 0x05, 0x00, 0x3C, 0x7E, 0x66, 0x66, 0x24,
  0x82, 0x00, 0x04, 0x1C, 0x2E, 0xBE, 0x3E, 0x1C, 0x99, 0x00, 0x81, 0xFF, 0x0D, 0xBD, 0x99, 0xFF,
  0xFF, 0x00, 0xFF, 0xBD, 0xFF, 0xC3, 0xFF, 0xC3, 0xFF, 0xBD, 0xFF, 0x84, 0x66, 0x82, 0xFF, 0xFE,
  0x00, 0xA8, 0x00, 0x07, 0x18, 0x3C, 0x3C, 0x18, 0x00, 0x00, 0x18, 0x00, 0x82, 0x66, 0x84, 0x00,
  0x81, 0x66, 0x20, 0xFF, 0x66, 0xFF, 0x66, 0x66, 0x00, 0x18, 0x3E, 0x60, 0x3C, 0x06, 0x7C, 0x18,
  0x00, 0xFF, 0x81, 0xB9, 0xA5, 0xB9, 0xA5, 0x81, 0xFF, 0x3C, 0x66, 0x3C, 0x38, 0x67, 0x66, 0x3F,
  0x00, 0x06, 0x0C, 0x18, 0x84, 0x00, 0x01, 0x0C, 0x18, 0x82, 0x30, 0x04, 0x18, 0x0C, 0x00, 0x30,
  0x18, 0x82, 0x0C, 0x08, 0x18, 0x30, 0x00, 0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x82, 0x00, 0x81,
  0x18, 0x02, 0x7E, 0x18, 0x18, 0x85, 0x00, 0x81, 0x18, 0x00, 0x30, 0x83, 0x00, 0x00, 0x7E, 0x88,
  0x00, 0x81, 0x18, 0x81, 0x00, 0x09, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0x00, 0xFE, 0xC6, 0xC6,
  0x82, 0xE6, 0x03, 0xFE, 0x00, 0x38, 0x38, 0x82, 0x18, 0x81, 0x3C, 0x2C, 0x00, 0xFE, 0x06, 0x06,
  0xFE, 0xC0, 0xC0, 0xFE, 0x00, 0xFC, 0x0C, 0x0C, 0x7E, 0x0E, 0x0E, 0xFE, 0x00, 0xC0, 0xC0, 0xC6,
  0xC6, 0xFE, 0x06, 0x06, 0x00, 0xFE, 0xC0, 0xC0, 0xFE, 0x06, 0x06, 0xFE, 0x00, 0xFC, 0xCC, 0xC0,
  0xFE, 0xC6, 0xC6, 0xFE, 0x00, 0xFE, 0xC6, 0x0C, 0x18, 0x82, 0x38, 0x0C, 0x00, 0x7E, 0x66, 0x66,
  0xFE, 0xE6, 0xE6, 0xFE, 0x00, 0xFE, 0xC6, 0xC6, 0xFE, 0x82, 0x0E, 0x82, 0x00, 0x03, 0x18, 0x00,
  0x00, 0x18, 0x83, 0x00, 0x0C, 0x18, 0x00, 0x00, 0x18, 0x30, 0x00, 0x0C, 0x18, 0x30, 0x60, 0x30,
  0x18, 0x0C, 0x82, 0x00, 0x02, 0x7E, 0x00, 0x7E, 0x82, 0x00, 0x0E, 0x30, 0x18, 0x0C, 0x06, 0x0C,
  0x18, 0x30, 0x00, 0x3C, 0x66, 0x06, 0x0C, 0x18, 0x00, 0x18, 0x88, 0x00, 0x03, 0x7E, 0x66, 0x66,
  0x7E, 0x82, 0xE6, 0x11, 0x00, 0xFC, 0xCC, 0xCC, 0xFE, 0xC6, 0xC6, 0xFE, 0x00, 0xFE, 0xCE, 0xCE,
  0xC0, 0xC0, 0xC6, 0xFE, 0x00, 0xFC, 0x84, 0xE6, 0x0D, 0xFC, 0x00, 0xFE, 0xC0, 0xC0, 0xF8, 0xE0,
  0xE0, 0xFE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LOR[] = {
  0x87, 0x41, 0x87, 0x21, 0x8F, 0x51, 0x87, 0xA1, 0x87, 0x21, 0x97, 0x41, 0x85, 0xE8, 0x01,
  0xE1, 0xE8, 0x87, 0xE4, 0x84, 0xE1, 0x02, 0xF1, 0xE1, 0xE1, 0xFE, 0x41, 0xFE, 0x41, 0xFE, 0x41,
  0xFE, 0x41, 0xFE, 0x41, 0xFE, 0x41, 0xFE, 0x41, 0xFE, 0x41, 0xFE, 0x41, 0xFE, 0x41, 0xFE, 0x41,
  0xFE, 0x41, 0xFE, 0x41, 0xFE, 0x41, 0xFE, 0x41, 0xAE, 0x41, 0xFF};

const byte RobotIMG[] = {
32,32,32,32,32,
32,1,9,5,32,
32,2,10,3,32,
32,4,11,4,32,
32,32,32,32,32,
};
  
void main(void)
{

screen_mode_2_text();
rle2vram(PATTERN,0x0000);
rle2vram(COLOR,0x2000);

duplicate_pattern();
cls();
screen_on();
print_at(0,0,"PUTFRAME EXAMPLE");
enable_nmi();
game=1;
robotx=15;roboty=8;movedelay=9;
put_frame(RobotIMG,robotx,roboty,5,5);
//Pointer, position on screen x, screen y, wide, height
while(game==1){
delay(1);
if(movedelay==0){
if(joypad_1 & LEFT){ robotx--;put_frame(RobotIMG,robotx,roboty,5,5);movedelay=9;}
if(joypad_1 & RIGHT){robotx++;put_frame(RobotIMG,robotx,roboty,5,5);movedelay=9;}
if(roboty!=0 && (joypad_1 & UP)){ roboty--;put_frame(RobotIMG,robotx,roboty,5,5);movedelay=9;}
if(roboty!=19 && (joypad_1 & DOWN)){roboty++;put_frame(RobotIMG,robotx,roboty,5,5);movedelay=9;}
}
if(movedelay!=0){movedelay--;}
}
}

void nmi(void) {

}

Just finished coding an example on put_frame.  Keep in mind, the bigger the tilemap is, the slower it'll draw.  put_frame0 is quicker because it doesn't check the border.  Put_frame you can pan the image off the side of the screen without issue.  But, Top and Bottom border are not checked, it'll write to the VRAM elsewhere.  The sprite table is right below the screen. 

 

Also, make sure it's close to delay(1); to avoid vram corruption and screen tearing.  There's screen tearing in Spunky's Supercar! for that reason and using 1 screen.  Flappe Byrd, I avoided that by doing double buffer the screen, swapping screen area 0x1800 and 0x1c00. 

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

IMPORTANT BUMP: Well I guess I bit off more than I can chew... As I am only a one man developer. I stretched myself too thin trying to make my games a wonderful multiplatform experience for everybody and It has been stressing me out, no help that there is currently a family emergency making things even tougher. So ALL CV related projects of mine are on hold until further notice, just to lower some weight. Will still make games for the 2600, Inty & even NES.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...