I don't know what I did, but when I run the program, the screen goes black and displays a bunch of pixels in the top left corner that doesn't resemble anything.
I think its the .h file, the train_data_compressed variable.

Code:
#ifndef sprite_train_H
#define sprite_train_H
#include <stdint.h>

extern uint8_t train_data_compressed[534];
#define train ((gfx_image_t*)train_data_compressed)
extern uint16_t sprite_train_pal[256];

#endif
No nothing is wrong with that. It's probably something in your code. Post that.
It might be something with the gfx_SetPalette. Otherwise, its probably in some other part of the program.
main.c

Code:
/* Keep these headers */
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <tice.h>
/* Standard headers - it's recommended to leave them included */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <lib/ce/graphx.h>


#include "sprite_train.h"

void train_jump(void);
void drawtrain_on(void);
void drawtrain_off(void);
void draw_tracks(void);
void drawobst(void);





int train_y=0, x=0, a=0, track[10], key;
bool death=0, quit=0;


void main(void){
    gfx_Begin(gfx_8bpp);
    gfx_SetPalette( sprite_train_pal, sizeof(sprite_train_pal), 0);
    gfx_TransparentSprite( train, 0, 0 );


train.c

Code:
#include <stdint.h>
#include "sprite_train.h"

uint8_t train_data_compressed[534] = {
 0x0A,0x4C,0x41,0x00,0x00,0x00,0x00,0x0A,0x04,0x04,0x0A,0x08,0x08,0x0A,0x10,0x10,0x0A,0x20,0x20,0x0A,0x40,0x40,0x0A,0x81,0x00,0x81,0x00,0x0A,0x82,0x00,0x82,0x00,0x0A,0x84,0x00,0x84,0x00,0x0A,0x87,0x4A,0x87,0x4A,0x02,0x02,0x02,0x02,0x0A,0x04,0x04,0x0A,0x08,0x08,0x0A,0x07,0x07,0x0A,0x35,0x4B,0x07,0x07,0x07,0x07,0x0A,0x04,0x04,0x0A,0x08,0x08,0x0A,0x07,0x07,0x0A,0x36,0x4D,0x0A,0x4A,0x81,0x18,0x00,0x02,0x01,0x01,0x01,0x01,0x0A,0x04,0x04,0x0A,0x08,0x08,0x0A,0x05,0x05,0x0A,0x4C,0x4C,0x0A,0x09,0x4C,0x0A,0x2D,0x81,0x2D,0x0A,0x06,0x4C,0x04,0x04,0x04,0x04,0x0A,0x04,0x04,0x04,0x04,0x04,0x0A,0x0F,0x4C,0x0A,0x2C,0x81,0x2D,0x0A,0x05,0x2D,0x0A,0x0B,0x4B,0x0A,0x06,0x4D,0x0A,0x0A,0x4C,0x09,0x09,0x09,0x09,0x0A,0x04,0x04,0x09,0x09,0x09,0x0A,0x41,0x4C,0x0A,0x4B,0x81,0x18,0x0A,0x0B,0x4D,0x0A,0x22,0x83,0x10,0x0A,0x4C,0x4C,0x0A,0x81,0x18,0x81,0x18,0x0A,0x6C,0x81,0x18,0x0A,0x09,0x4D,0x0A,0x23,0x86,0x0B,0x0A,0x21,0x86,0x44,0x0A,0x4C,0x4C,0x0A,0x42,0x4C,0x0A,0x17,0x88,0x3F,0x0A,0x1E,0x87,0x17,0x0A,0x17,0x4C,0x0A,0x15,0x16,0x0A,0x20,0x81,0x21,0x0A,0x19,0x4C,0x02,0x02,0x02,0x0A,0x09,0x1C,0x0A,0x07,0x09,0x0A,0x05,0x81,0x16,0x0A,0x30,0x4C,0x0A,0x07,0x4B,0x0A,0x08,0x4D,0x0A,0x07,0x08,0x0A,0x08,0x13,0x0A,0x19,0x4D,0x0A,0x1A,0x4C,0x0A,0x0C,0x82,0x3D,0x0A,0x0E,0x1B,0x0A,0x3B,0x4C,0x0A,0x0E,0x58,0x0A,0x4B,0x4C,0x0A,0x04,0x04,0x09,0x0A,0x45,0x4C,0x0A,0x05,0x0A,0x0A,0x22,0x4C,0x0A,0x07,0x84,0x3D,0x0A,0x1F,0x4C,0x0A,0x1D,0x84,0x15,0x0A,0x09,0x85,0x57,0x0A,0x0D,0x2E,0x0A,0x17,0x4C,0x0A,0x06,0x09,0x0A,0x20,0x4C,0x02,0x01,0x01,0x03,0x03,0x03,0x03,0x03,0x0A,0x07,0x82,0x12,0x0A,0x15,0x84,0x14,0x0A,0x08,0x71,0x0A,0x1F,0x4C,0x0A,0x08,0x4B,0x0A,0x0F,0x4D,0x0A,0x0D,0x84,0x57,0x0A,0x21,0x81,0x17,0x0A,0x06,0x4C,0x0A,0x0A,0x4B,0x0A,0x07,0x4D,0x0A,0x3A,0x86,0x44,0x0A,0x0C,0x4B,0x0A,0x06,0x4D,0x0A,0x3A,0x87,0x5C,0x02,0x0A,0x06,0x4B,0x02,0x02,0x02,0x0A,0x06,0x4D,0x0A,0x08,0x81,0x16,0x03,0x03,0x03,0x05,0x05,0x05,0x05,0x0A,0x04,0x04,0x01,0x05,0x05,0x0A,0x08,0x0E,0x02,0x08,0x0A,0x22,0x4C,0x0A,0x05,0x74,0x0A,0x0B,0x4C,0x03,0x03,0x03,0x06,0x06,0x06,0x06,0x0A,0x04,0x04,0x0A,0x07,0x07,0x0A,0x07,0x4E,0x0A,0x19,0x4D,0x0A,0x1D,0x4C,0x0A,0x0E,0x4D,0x0A,0x04,0x11,0x0A,0x04,0x4C,0x08,0x0A,0x18,0x4D,0x0A,0x05,0x86,0x61,0x0A,0x14,0x4C,0x0A,0x05,0x13,0x0A,0x08,0x3F,0x05,0x0A,0x0C,0x0E,0x02,0x0A,0x1C,0x4D,0x0A,0x15,0x82,0x30,0x0A,0x09,0x11,0x0A,0x08,0x4C,0x0A,0x09,0x0E,0x08,0x0A,0x1C,0x4D,0x0A,0x07,0x44,0x0A,0x07,0x83,0x48,0x0A,0x07,0x83,0x2E,0x0A,0x09,0x81,0x0A,0x0A,0x0D,0x0E,0x0A,0x05,0x8A,0x0D,0x0A,0x1B,0x4D,0x0A,0x05,0x05,0x0A,0x09,0x4B,0x0A,0x10,0x12,0x0A,0x0E,0x0E,0x0A,0x06,0x7B,0x0A,0x27,0x4D,0x0A,0x11,0x11,0x0A,0x18,0x1F,0x0A,0x1D,0x8D,0x12,0x0A,0x12,0x2C,0x0A,0x0E,0x10,0x0A,0x0E,0x0E,
};


Sprite_train.c

Code:
#include <stdint.h>
#include "sprite_train.h"

uint16_t sprite_train_pal[256] = {
 0x25C9,  // 00 :: rgba(71,112,76,0)
 0x7CC3,  // 01 :: rgba(255,48,25,255)
 0x0000,  // 02 :: rgba(0,0,0,255)
 0x739C,  // 03 :: rgba(229,225,228,255)
 0x03FF,  // 04 :: rgba(0,252,254,255)
 0x7CC3,  // 05 :: rgba(255,48,22,255)
 0x56B5,  // 06 :: rgba(172,169,172,255)
 0xFBBD,  // 07 :: rgba(243,238,242,255)
 0xE739,  // 08 :: rgba(209,205,208,255)
 0x6759,  // 09 :: rgba(208,209,208,255)
 0x0000,  // 10 :: rgba(0,0,0,0)
 0x0000,  // 11 :: rgba(0,0,0,0)
 0x0000,  // 12 :: rgba(0,0,0,0)
 0x0000,  // 13 :: rgba(0,0,0,0)
 0x0000,  // 14 :: rgba(0,0,0,0)
 0x0000,  // 15 :: rgba(0,0,0,0)
 0x0000,  // 16 :: rgba(0,0,0,0)
 0x0000,  // 17 :: rgba(0,0,0,0)
 0x0000,  // 18 :: rgba(0,0,0,0)
 0x0000,  // 19 :: rgba(0,0,0,0)
 0x0000,  // 20 :: rgba(0,0,0,0)
 0x0000,  // 21 :: rgba(0,0,0,0)
 0x0000,  // 22 :: rgba(0,0,0,0)
 0x0000,  // 23 :: rgba(0,0,0,0)
 0x0000,  // 24 :: rgba(0,0,0,0)
 0x0000,  // 25 :: rgba(0,0,0,0)
 0x0000,  // 26 :: rgba(0,0,0,0)
 0x0000,  // 27 :: rgba(0,0,0,0)
 0x0000,  // 28 :: rgba(0,0,0,0)
 0x0000,  // 29 :: rgba(0,0,0,0)
 0x0000,  // 30 :: rgba(0,0,0,0)
 0x0000,  // 31 :: rgba(0,0,0,0)
 0x0000,  // 32 :: rgba(0,0,0,0)
 0x0000,  // 33 :: rgba(0,0,0,0)
 0x0000,  // 34 :: rgba(0,0,0,0)
 0x0000,  // 35 :: rgba(0,0,0,0)
 0x0000,  // 36 :: rgba(0,0,0,0)
 0x0000,  // 37 :: rgba(0,0,0,0)
 0x0000,  // 38 :: rgba(0,0,0,0)
 0x0000,  // 39 :: rgba(0,0,0,0)
 0x0000,  // 40 :: rgba(0,0,0,0)
 0x0000,  // 41 :: rgba(0,0,0,0)
 0x0000,  // 42 :: rgba(0,0,0,0)
 0x0000,  // 43 :: rgba(0,0,0,0)
 0x0000,  // 44 :: rgba(0,0,0,0)
 0x0000,  // 45 :: rgba(0,0,0,0)
 0x0000,  // 46 :: rgba(0,0,0,0)
 0x0000,  // 47 :: rgba(0,0,0,0)
 0x0000,  // 48 :: rgba(0,0,0,0)
 0x0000,  // 49 :: rgba(0,0,0,0)
 0x0000,  // 50 :: rgba(0,0,0,0)
 0x0000,  // 51 :: rgba(0,0,0,0)
 0x0000,  // 52 :: rgba(0,0,0,0)
 0x0000,  // 53 :: rgba(0,0,0,0)
 0x0000,  // 54 :: rgba(0,0,0,0)
 0x0000,  // 55 :: rgba(0,0,0,0)
 0x0000,  // 56 :: rgba(0,0,0,0)
 0x0000,  // 57 :: rgba(0,0,0,0)
 0x0000,  // 58 :: rgba(0,0,0,0)
 0x0000,  // 59 :: rgba(0,0,0,0)
 0x0000,  // 60 :: rgba(0,0,0,0)
 0x0000,  // 61 :: rgba(0,0,0,0)
 0x0000,  // 62 :: rgba(0,0,0,0)
 0x0000,  // 63 :: rgba(0,0,0,0)
 0x0000,  // 64 :: rgba(0,0,0,0)
 0x0000,  // 65 :: rgba(0,0,0,0)
 0x0000,  // 66 :: rgba(0,0,0,0)
 0x0000,  // 67 :: rgba(0,0,0,0)
 0x0000,  // 68 :: rgba(0,0,0,0)
 0x0000,  // 69 :: rgba(0,0,0,0)
 0x0000,  // 70 :: rgba(0,0,0,0)
 0x0000,  // 71 :: rgba(0,0,0,0)
 0x0000,  // 72 :: rgba(0,0,0,0)
 0x0000,  // 73 :: rgba(0,0,0,0)
 0x0000,  // 74 :: rgba(0,0,0,0)
 0x0000,  // 75 :: rgba(0,0,0,0)
 0x0000,  // 76 :: rgba(0,0,0,0)
 0x0000,  // 77 :: rgba(0,0,0,0)
 0x0000,  // 78 :: rgba(0,0,0,0)
 0x0000,  // 79 :: rgba(0,0,0,0)
 0x0000,  // 80 :: rgba(0,0,0,0)
 0x0000,  // 81 :: rgba(0,0,0,0)
 0x0000,  // 82 :: rgba(0,0,0,0)
 0x0000,  // 83 :: rgba(0,0,0,0)
 0x0000,  // 84 :: rgba(0,0,0,0)
 0x0000,  // 85 :: rgba(0,0,0,0)
 0x0000,  // 86 :: rgba(0,0,0,0)
 0x0000,  // 87 :: rgba(0,0,0,0)
 0x0000,  // 88 :: rgba(0,0,0,0)
 0x0000,  // 89 :: rgba(0,0,0,0)
 0x0000,  // 90 :: rgba(0,0,0,0)
 0x0000,  // 91 :: rgba(0,0,0,0)
 0x0000,  // 92 :: rgba(0,0,0,0)
 0x0000,  // 93 :: rgba(0,0,0,0)
 0x0000,  // 94 :: rgba(0,0,0,0)
 0x0000,  // 95 :: rgba(0,0,0,0)
 0x0000,  // 96 :: rgba(0,0,0,0)
 0x0000,  // 97 :: rgba(0,0,0,0)
 0x0000,  // 98 :: rgba(0,0,0,0)
 0x0000,  // 99 :: rgba(0,0,0,0)
 0x0000,  // 100 :: rgba(0,0,0,0)
 0x0000,  // 101 :: rgba(0,0,0,0)
 0x0000,  // 102 :: rgba(0,0,0,0)
 0x0000,  // 103 :: rgba(0,0,0,0)
 0x0000,  // 104 :: rgba(0,0,0,0)
 0x0000,  // 105 :: rgba(0,0,0,0)
 0x0000,  // 106 :: rgba(0,0,0,0)
 0x0000,  // 107 :: rgba(0,0,0,0)
 0x0000,  // 108 :: rgba(0,0,0,0)
 0x0000,  // 109 :: rgba(0,0,0,0)
 0x0000,  // 110 :: rgba(0,0,0,0)
 0x0000,  // 111 :: rgba(0,0,0,0)
 0x0000,  // 112 :: rgba(0,0,0,0)
 0x0000,  // 113 :: rgba(0,0,0,0)
 0x0000,  // 114 :: rgba(0,0,0,0)
 0x0000,  // 115 :: rgba(0,0,0,0)
 0x0000,  // 116 :: rgba(0,0,0,0)
 0x0000,  // 117 :: rgba(0,0,0,0)
 0x0000,  // 118 :: rgba(0,0,0,0)
 0x0000,  // 119 :: rgba(0,0,0,0)
 0x0000,  // 120 :: rgba(0,0,0,0)
 0x0000,  // 121 :: rgba(0,0,0,0)
 0x0000,  // 122 :: rgba(0,0,0,0)
 0x0000,  // 123 :: rgba(0,0,0,0)
 0x0000,  // 124 :: rgba(0,0,0,0)
 0x0000,  // 125 :: rgba(0,0,0,0)
 0x0000,  // 126 :: rgba(0,0,0,0)
 0x0000,  // 127 :: rgba(0,0,0,0)
 0x0000,  // 128 :: rgba(0,0,0,0)
 0x0000,  // 129 :: rgba(0,0,0,0)
 0x0000,  // 130 :: rgba(0,0,0,0)
 0x0000,  // 131 :: rgba(0,0,0,0)
 0x0000,  // 132 :: rgba(0,0,0,0)
 0x0000,  // 133 :: rgba(0,0,0,0)
 0x0000,  // 134 :: rgba(0,0,0,0)
 0x0000,  // 135 :: rgba(0,0,0,0)
 0x0000,  // 136 :: rgba(0,0,0,0)
 0x0000,  // 137 :: rgba(0,0,0,0)
 0x0000,  // 138 :: rgba(0,0,0,0)
 0x0000,  // 139 :: rgba(0,0,0,0)
 0x0000,  // 140 :: rgba(0,0,0,0)
 0x0000,  // 141 :: rgba(0,0,0,0)
 0x0000,  // 142 :: rgba(0,0,0,0)
 0x0000,  // 143 :: rgba(0,0,0,0)
 0x0000,  // 144 :: rgba(0,0,0,0)
 0x0000,  // 145 :: rgba(0,0,0,0)
 0x0000,  // 146 :: rgba(0,0,0,0)
 0x0000,  // 147 :: rgba(0,0,0,0)
 0x0000,  // 148 :: rgba(0,0,0,0)
 0x0000,  // 149 :: rgba(0,0,0,0)
 0x0000,  // 150 :: rgba(0,0,0,0)
 0x0000,  // 151 :: rgba(0,0,0,0)
 0x0000,  // 152 :: rgba(0,0,0,0)
 0x0000,  // 153 :: rgba(0,0,0,0)
 0x0000,  // 154 :: rgba(0,0,0,0)
 0x0000,  // 155 :: rgba(0,0,0,0)
 0x0000,  // 156 :: rgba(0,0,0,0)
 0x0000,  // 157 :: rgba(0,0,0,0)
 0x0000,  // 158 :: rgba(0,0,0,0)
 0x0000,  // 159 :: rgba(0,0,0,0)
 0x0000,  // 160 :: rgba(0,0,0,0)
 0x0000,  // 161 :: rgba(0,0,0,0)
 0x0000,  // 162 :: rgba(0,0,0,0)
 0x0000,  // 163 :: rgba(0,0,0,0)
 0x0000,  // 164 :: rgba(0,0,0,0)
 0x0000,  // 165 :: rgba(0,0,0,0)
 0x0000,  // 166 :: rgba(0,0,0,0)
 0x0000,  // 167 :: rgba(0,0,0,0)
 0x0000,  // 168 :: rgba(0,0,0,0)
 0x0000,  // 169 :: rgba(0,0,0,0)
 0x0000,  // 170 :: rgba(0,0,0,0)
 0x0000,  // 171 :: rgba(0,0,0,0)
 0x0000,  // 172 :: rgba(0,0,0,0)
 0x0000,  // 173 :: rgba(0,0,0,0)
 0x0000,  // 174 :: rgba(0,0,0,0)
 0x0000,  // 175 :: rgba(0,0,0,0)
 0x0000,  // 176 :: rgba(0,0,0,0)
 0x0000,  // 177 :: rgba(0,0,0,0)
 0x0000,  // 178 :: rgba(0,0,0,0)
 0x0000,  // 179 :: rgba(0,0,0,0)
 0x0000,  // 180 :: rgba(0,0,0,0)
 0x0000,  // 181 :: rgba(0,0,0,0)
 0x0000,  // 182 :: rgba(0,0,0,0)
 0x0000,  // 183 :: rgba(0,0,0,0)
 0x0000,  // 184 :: rgba(0,0,0,0)
 0x0000,  // 185 :: rgba(0,0,0,0)
 0x0000,  // 186 :: rgba(0,0,0,0)
 0x0000,  // 187 :: rgba(0,0,0,0)
 0x0000,  // 188 :: rgba(0,0,0,0)
 0x0000,  // 189 :: rgba(0,0,0,0)
 0x0000,  // 190 :: rgba(0,0,0,0)
 0x0000,  // 191 :: rgba(0,0,0,0)
 0x0000,  // 192 :: rgba(0,0,0,0)
 0x0000,  // 193 :: rgba(0,0,0,0)
 0x0000,  // 194 :: rgba(0,0,0,0)
 0x0000,  // 195 :: rgba(0,0,0,0)
 0x0000,  // 196 :: rgba(0,0,0,0)
 0x0000,  // 197 :: rgba(0,0,0,0)
 0x0000,  // 198 :: rgba(0,0,0,0)
 0x0000,  // 199 :: rgba(0,0,0,0)
 0x0000,  // 200 :: rgba(0,0,0,0)
 0x0000,  // 201 :: rgba(0,0,0,0)
 0x0000,  // 202 :: rgba(0,0,0,0)
 0x0000,  // 203 :: rgba(0,0,0,0)
 0x0000,  // 204 :: rgba(0,0,0,0)
 0x0000,  // 205 :: rgba(0,0,0,0)
 0x0000,  // 206 :: rgba(0,0,0,0)
 0x0000,  // 207 :: rgba(0,0,0,0)
 0x0000,  // 208 :: rgba(0,0,0,0)
 0x0000,  // 209 :: rgba(0,0,0,0)
 0x0000,  // 210 :: rgba(0,0,0,0)
 0x0000,  // 211 :: rgba(0,0,0,0)
 0x0000,  // 212 :: rgba(0,0,0,0)
 0x0000,  // 213 :: rgba(0,0,0,0)
 0x0000,  // 214 :: rgba(0,0,0,0)
 0x0000,  // 215 :: rgba(0,0,0,0)
 0x0000,  // 216 :: rgba(0,0,0,0)
 0x0000,  // 217 :: rgba(0,0,0,0)
 0x0000,  // 218 :: rgba(0,0,0,0)
 0x0000,  // 219 :: rgba(0,0,0,0)
 0x0000,  // 220 :: rgba(0,0,0,0)
 0x0000,  // 221 :: rgba(0,0,0,0)
 0x0000,  // 222 :: rgba(0,0,0,0)
 0x0000,  // 223 :: rgba(0,0,0,0)
 0x0000,  // 224 :: rgba(0,0,0,0)
 0x0000,  // 225 :: rgba(0,0,0,0)
 0x0000,  // 226 :: rgba(0,0,0,0)
 0x0000,  // 227 :: rgba(0,0,0,0)
 0x0000,  // 228 :: rgba(0,0,0,0)
 0x0000,  // 229 :: rgba(0,0,0,0)
 0x0000,  // 230 :: rgba(0,0,0,0)
 0x0000,  // 231 :: rgba(0,0,0,0)
 0x0000,  // 232 :: rgba(0,0,0,0)
 0x0000,  // 233 :: rgba(0,0,0,0)
 0x0000,  // 234 :: rgba(0,0,0,0)
 0x0000,  // 235 :: rgba(0,0,0,0)
 0x0000,  // 236 :: rgba(0,0,0,0)
 0x0000,  // 237 :: rgba(0,0,0,0)
 0x0000,  // 238 :: rgba(0,0,0,0)
 0x0000,  // 239 :: rgba(0,0,0,0)
 0x0000,  // 240 :: rgba(0,0,0,0)
 0x0000,  // 241 :: rgba(0,0,0,0)
 0x0000,  // 242 :: rgba(0,0,0,0)
 0x0000,  // 243 :: rgba(0,0,0,0)
 0x0000,  // 244 :: rgba(0,0,0,0)
 0x0000,  // 245 :: rgba(0,0,0,0)
 0x0000,  // 246 :: rgba(0,0,0,0)
 0x0000,  // 247 :: rgba(0,0,0,0)
 0x0000,  // 248 :: rgba(0,0,0,0)
 0x0000,  // 249 :: rgba(0,0,0,0)
 0x0000,  // 250 :: rgba(0,0,0,0)
 0x0000,  // 251 :: rgba(0,0,0,0)
 0x0000,  // 252 :: rgba(0,0,0,0)
 0x0000,  // 253 :: rgba(0,0,0,0)
 0x0000,  // 254 :: rgba(0,0,0,0)
 0x0000   // 255 :: rgba(0,0,0,0)
};
Well something is wrong with sprite_train.c. Every one of those is supposed to have values. Are you using the xLibc Palette? In your convpng.ini file, do you have:

Code:
#Palette: xlibc
?
Where should I put it? I currently don't have the #Palette: at all. I just modified the original one in the example. Is there anything else I should add?

Code:
#GroupC          : sprite_train#Compression         
: lz77
#PNGImages         :
 train
Before #PNGImages and I think you have to put train.png after #PNGImages:, I'm not sure, I would just in case.
Oh, you aren't going going to want to use compression, you need some other commands to get them to display. So just delete #compression and :lz77
I finally got it working! Thanks for the help! Next question: is there a way to remove the sprite background?
Use gfx_TransparentSprite(); and make sure your convpng.ini has #TranspColor : 255,255,255,255
seanlego23 wrote:
Use gfx_TransparentSprite(); and make sure your convpng.ini has #TranspColor : 255,255,255,255


Exactly that, but you would have to make transparent color white. Just get the rgb for whatever color you do want to be transparent. This tool may help: http://htmlcolorcodes.com/color-picker/
Unicorn wrote:
seanlego23 wrote:
Use gfx_TransparentSprite(); and make sure your convpng.ini has #TranspColor : 255,255,255,255


Exactly that, but you would have to make transparent color white. Just get the rgb for whatever color you do want to be transparent. This tool may help: http://htmlcolorcodes.com/color-picker/

And add the last 255. It's for transparency or something like that, but it's important.
I'm having a problem with the keypress. I can press it once, but after that, it wont do anything.

Code:
    while(death==0){
        key = kb_ScanGroup(kb_group_7);
        draw_tracks();
       
        if (key == kb_Up) {
            train_jump();
        }

    }
Try this:


Code:

if (key & kb_Up)
      train_jump();
That still doesn't work Sad It might be something with my train_jump function.

Code:
void train_jump(void){
    for(a=95;a>60;a--){
        for(x=0; x<30;x++){gfx_Sprite( train, 0, a );}
        drawtrain_off();
        draw_tracks();
    }
    for(;a=95;a++){
        for(x=0; x<30;x++){gfx_Sprite( train, 0, a );}
        drawtrain_off();
        draw_tracks();
    }
}
hmm... Does your key-getting loop look like this?


Code:

 while(death==0){
        key = kb_ScanGroup(kb_group_7);
        draw_tracks();
         
        if (key & kb_Up) {
            train_jump();
        }
 }


if so, you may want to put the kb_ScanGroup at the bottom of the loop.

Code:

 while(death==0){
        draw_tracks();
         
        if (key & kb_Up) {
            train_jump();
        }
        key = kb_ScanGroup(kb_group_7); 
 }
calcnerd_CEP_D wrote:
That still doesn't work Sad It might be something with my train_jump function.

Code:
void train_jump(void){
    for(a=95;a>60;a--){
        for(x=0; x<30;x++){gfx_Sprite( train, 0, a );}
        drawtrain_off();
        draw_tracks();
    }
    for(;a=95;a++){  //<--------
        for(x=0; x<30;x++){gfx_Sprite( train, 0, a );}
        drawtrain_off();
        draw_tracks();
    }
}
Changing for(;a=95;a++){ to for(;a<=95;a++){ should work.
It works now! Very Happy Thank you so much guys.
EDIT: Here's my first screenshot!
Looking good, but I'm gonna be greedy ask for more: can we get an animated screenshot? Razz
1. How do I submit my entry?

2. I've got the obstacle moving, but every time I jump, the obstacle speeds up. What can I do to fix this?
Code:
    while(death==0){
       
        draw_tracks();
        gfx_Sprite( train, 0, 96 );
       
        if (key & kb_Up) {
            train_jump();
        }
        if (137<=a+65 & (obst_x<=76 & obst_x>=20)){
            death=1;
        }
       
        if (obst_x<=0){
            obst_x=350;
        }
        key = kb_ScanGroup(kb_group_7);
    }
}
void draw_tracks(){
    //draw the tracks
    gfx_SetColor(181);
    gfx_FillRectangle_NoClip(0,161,320,1);
    gfx_SetColor(170);
    for(x=0; x<320; x+=10){
        gfx_FillRectangle_NoClip(x,162,8,2);
    }
    obst_off();
    obst_x-=4;
    gfx_Sprite( obstacle, obst_x, 137);
   
}

void train_jump(void){
    for(a=96;a>40;a--){
        for(x=0; x<25;x++){gfx_Sprite( train, 0, a );}
        drawtrain_off();
        draw_tracks();
    }
    for(;a<=96;a++){
        for(x=0; x<25;x++){gfx_Sprite( train, 0, a );}
        drawtrain_off();
        draw_tracks();
    }
}

void obst_off(void){
    gfx_SetColor(95);
    gfx_FillRectangle_NoClip(obst_x,137,24,24);
}
To submit, check this post: https://www.cemetech.net/forum/viewtopic.php?p=251980#251980

Does the object visible speed up? It could be because you are taking some display things off the screen, thus resulting in a speedup.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 3
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement