delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/18/21:46:09

From: "Paradox" <ennui AT nettaxi DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Here we go again
Date: 18 Feb 1999 18:18:21 PST
Organization: Concentric Internet Services
Lines: 57
Message-ID: <7aihld$307@chronicle.concentric.net>
NNTP-Posting-Host: ts004d10.chi-il.concentric.net
X-Newsreader: Microsoft Outlook Express 4.72.3155.0
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I've been studing various source codes and documents, but once again I've
run into a dead end. I fixed that GPF error (Thanks guys) but ran into a new
one when I discovered how to stuff my pics and sound into a .dat file.
Everything seems to start up fine, but the palette is all goofed up. Black
shows as yellow, or blue. Red shows as black or grey. The sound is choppy
and sounds like someone is grinding a gear. And the keyboard is
unresponsive. Included is the various codes that correspond with my
problems.

void introduction(void) {
  BITMAP *ego = create_bitmap(640, 480);
  clear(ego);
  map = map_data[MAP_1].dat;
  ship = sprite_data[SHIP_BASIC].dat;
  blit(map_data[TITLE].dat, screen, 0, 0, 0, 0, 640, 480);
  blit(map, ego, 0, 0, 0, 0, 640, 480);
  draw_sprite(ego, ship, PS.player_x, PS.player_y);
  readkey();
  blit(ego, screen, 0, 0, 0, 0, 640, 480);
  destroy_bitmap(ego);
}


int main() {
  init_game();
  game_on = 1;
  while(game_on) {
    play_midi(mid, 1);
    recieve_wishes();
    grant_wish();
  }
  shutdown();
}

void recieve_wishes(void) {
  if_directions();
  clear_keybuf();
  if_weapon();
  clear_keybuf();
  if(key[KEY_ESC]) { game_on = 0; }
}

void if_directions(void) {
  if(key[KEY_UP])    { PS.player_y--; }
  if(key[KEY_DOWN])  { PS.player_y++; }
  if(key[KEY_LEFT])  { PS.player_x--; }
  if(key[KEY_RIGHT]) { PS.player_x++; }
  check_location();
}


Thanks for your help again

Paradox
ennui AT nettaxi DOT com


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019