Short simple menu? (gaming)

Status
Not open for further replies.

Duhjoker

Well-known member
Ok guys I need to create a short simple menu system that can be expanded upon. One of the users over at gamebuino wrote a small simple menu system a long while back when I first started the project. but I don't understand how the slot system work or how to get the item to appear in the right slot or really how to get any thing into a slot. I'm not seeing any kind of coordinate system that will put the item in to a slot in the menu. And its a lil funky.

Here's a link to the OG page where the instruction is given....

http://legacy.gamebuino.com/forum/viewtopic.php?f=8&t=3492


I also found the sketch and removed every thing but the menu stuff

Code:
#ifndef _Menu_H_
#define _Menu_H_

#include "Variables.h"

int menu_1 = 1;
int key_1 = 1;
int key_2 = 1;
int sox_1 = 1;

 int menuy = -84;
 int keyy = -76;
 int scroll1;

/////add item_loc's here////
int key_loc;
int key2_loc;
int sox_loc;

////item slot locations////
int keyslot;
int keyslot2;
int soxslot;

int Active_slot;
int S1 = 0;
int S2 = 0;
int S3 = 0;
int S4 = 0;

const byte menu1[] PROGMEM = {88,49,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111100,B00000000,B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B00000000,B00010001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000,B10000000,B00100110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B01000000,B00101000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B01000000,B01001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B00100000,B01010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10100000,B01010000,B11111111,B11111000,B00111111,B11111110,B00001111,B11111111,B10000011,B11111111,B11100000,B10100000,B01010000,B10000000,B00001000,B00100000,B00000010,B00001000,B00000000,B10000010,B00000000,B00100000,B10100000,B01010000,B10000000,B00001000,B00100000,B00000010,B00001000,B00000000,B10000010,B00000000,B00100000,B10100000,B01010000,B10000000,B00001000,B00100000,B00000010,B00001000,B00000000,B10000010,B00000000,B00100000,B10100000,B01010000,B10000000,B00001000,B00100000,B00000010,B00001000,B00000000,B10000010,B00000000,B00100000,B10100000,B01010000,B10000000,B00001000,B00100000,B00000010,B00001000,B00000000,B10000010,B00000000,B00100000,B10100000,B01010000,B10000000,B00001000,B00100000,B00000010,B00001000,B00000000,B10000010,B00000000,B00100000,B10100000,B01010000,B10000000,B00001000,B00100000,B00000010,B00001000,B00000000,B10000010,B00000000,B00100000,B10100000,B01010000,B10000000,B00001000,B00100000,B00000010,B00001000,B00000000,B10000010,B00000000,B00100000,B10100000,B01010000,B10000000,B00001000,B00100000,B00000010,B00001000,B00000000,B10000010,B00000000,B00100000,B10100000,B01010000,B10000000,B00001000,B00100000,B00000010,B00001000,B00000000,B10000010,B00000000,B00100000,B10100000,B01010000,B10000000,B00001000,B00100000,B00000010,B00001000,B00000000,B10000010,B00000000,B00100000,B10100000,B01010000,B11111111,B11111000,B00111111,B11111110,B00001111,B11111111,B10000011,B11111111,B11100000,B10100000,B01010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10100000,B01010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10100000,B01010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10100000,B01010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10100000,B01010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10100000,B01010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10100000,B01010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10100000,B01010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10100000,B01010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10100000,B01010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10100000,B01010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10100000,B01010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10100000,B01010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10100000,B01010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10100000,B01010000,B00000000,B00000001,B11111111,B11111111,B11111111,B11111111,B11111000,B00000000,B00000000,B10100000,B01010000,B00000000,B00000010,B00000000,B00000000,B00000000,B00000000,B00000100,B00000000,B00000000,B10100000,B01001000,B00000000,B00000100,B11111111,B11111111,B11111111,B11111111,B11110010,B00000000,B00000001,B00100000,B00101000,B00000000,B00000101,B00000000,B00000000,B00000000,B00000000,B00001010,B00000000,B00000001,B01000000,B00100110,B00000000,B00000101,B01110000,B00000000,B00000010,B00000000,B00001010,B00000000,B00000110,B01000000,B00010001,B11111111,B11111101,B00100110,B01010011,B01100111,B00100110,B10101011,B11111111,B11111000,B10000000,B00001100,B00000000,B00000001,B00100101,B01010110,B01010010,B01010100,B11101000,B00000000,B00000011,B00000000,B00000011,B11111111,B11111101,B01110101,B00100011,B01010010,B00100100,B00101011,B11111111,B11111100,B00000000,B00000000,B00000000,B00000101,B00000000,B00000000,B00000000,B00000000,B11001010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000101,B00000000,B00000000,B00000000,B00000000,B00001010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B11111111,B11111111,B11111111,B11111111,B11110010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,B00000000,B00000000,B00000000,B00000000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111111,B11111111,B11111111,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,};
const byte menu2[] PROGMEM = {88,49,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111100,B00000000,B00001110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00000000,B00011001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111001,B10000000,B00010111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111110,B10000000,B00110111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111110,B11000000,B00101111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B01000000,B00101111,B00000000,B00000111,B11000000,B00000001,B11110000,B00000000,B01111100,B00000000,B00011111,B01000000,B00101111,B01111111,B11110111,B11011111,B11111101,B11110111,B11111111,B01111101,B11111111,B11011111,B01000000,B00101111,B01111111,B11110111,B11011111,B11111101,B11110111,B11111111,B01111101,B11111111,B11011111,B01000000,B00101111,B01111111,B11110111,B11011111,B11111101,B11110111,B11111111,B01111101,B11111111,B11011111,B01000000,B00101111,B01111111,B11110111,B11011111,B11111101,B11110111,B11111111,B01111101,B11111111,B11011111,B01000000,B00101111,B01111111,B11110111,B11011111,B11111101,B11110111,B11111111,B01111101,B11111111,B11011111,B01000000,B00101111,B01111111,B11110111,B11011111,B11111101,B11110111,B11111111,B01111101,B11111111,B11011111,B01000000,B00101111,B01111111,B11110111,B11011111,B11111101,B11110111,B11111111,B01111101,B11111111,B11011111,B01000000,B00101111,B01111111,B11110111,B11011111,B11111101,B11110111,B11111111,B01111101,B11111111,B11011111,B01000000,B00101111,B01111111,B11110111,B11011111,B11111101,B11110111,B11111111,B01111101,B11111111,B11011111,B01000000,B00101111,B01111111,B11110111,B11011111,B11111101,B11110111,B11111111,B01111101,B11111111,B11011111,B01000000,B00101111,B01111111,B11110111,B11011111,B11111101,B11110111,B11111111,B01111101,B11111111,B11011111,B01000000,B00101111,B00000000,B00000111,B11000000,B00000001,B11110000,B00000000,B01111100,B00000000,B00011111,B01000000,B00101111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B01000000,B00101111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B01000000,B00101111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B01000000,B00101111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B01000000,B00101111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B01000000,B00101111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B01000000,B00101111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B01000000,B00101111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B01000000,B00101111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B01000000,B00101111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B01000000,B00101111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B01000000,B00101111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B01000000,B00101111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B01000000,B00101111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B01000000,B00101111,B11111111,B11111110,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111,B01000000,B00101111,B11111111,B11111101,B11111111,B11111111,B11111111,B11111111,B11111011,B11111111,B11111111,B01000000,B00110111,B11111111,B11111011,B00000000,B00000000,B00000000,B00000000,B00001101,B11111111,B11111110,B11000000,B00010111,B11111111,B11111010,B11111111,B11111111,B11111111,B11111111,B11110101,B11111111,B11111110,B10000000,B00011001,B11111111,B11111010,B10001111,B11111111,B11111101,B11111111,B11110101,B11111111,B11111001,B10000000,B00001110,B00000000,B00000010,B11011001,B10101100,B10011000,B11011001,B01010100,B00000000,B00000111,B00000000,B00000011,B11111111,B11111110,B11011010,B10101001,B10101101,B10101011,B00010111,B11111111,B11111100,B00000000,B00000000,B00000000,B00000010,B10001010,B11011100,B10101101,B11011011,B11010100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,B11111111,B11111111,B11111111,B11111111,B00110100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,B11111111,B11111111,B11111111,B11111111,B11110100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111111,B11111111,B11111111,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,};
const byte key[] PROGMEM = {16,21,B11111111,B11111000,B10000000,B00001000,B10000000,B00001000,B10000000,B00001000,B10000001,B11001000,B10000001,B01001000,B10001011,B11001000,B10010111,B00001000,B10001110,B00001000,B10001100,B00001000,B10000000,B00001000,B10000000,B00001000,B11111111,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000000,B00000000,B01010011,B01010000,B01100110,B01110000,B01010011,B00010000,B00000000,B01100000,};
const byte key2[] PROGMEM = {16,21,B11111111,B11111000,B10000000,B00001000,B10000000,B00001000,B10000000,B00001000,B10000001,B11001000,B10000001,B01001000,B10001011,B11001000,B10010111,B00001000,B10001110,B00001000,B10001100,B00001000,B10000000,B00001000,B10000000,B00001000,B11111111,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000000,B00000000,B01010011,B01010000,B01100110,B01110000,B01010011,B00010000,B00000000,B01100000,};
const byte sox[] PROGMEM = {16,21,B01111111,B11111100,B01000000,B00000100,B01000000,B00000100,B01000001,B11100100,B01000001,B00100100,B01000001,B11100100,B01000111,B00100100,B01001000,B00100100,B01001000,B01000100,B01000111,B10000100,B01000000,B00000100,B01000000,B00000100,B01111111,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01100000,B00001000,B10000100,B01101010,B00101010,B10001100,B11000100,B01101010,B00000000,B00000000,};



     if(S1==0 && S2==0 && S3==0 && S4==0){Active_slot = 1;}
else if(S1==1 && S2==0 && S3==0 && S4==0){Active_slot = 2;}
else if(S1==1 && S2==1 && S3==0 && S4==0){Active_slot = 3;}
else if(S1==1 && S2==1 && S3==1 && S4==0){Active_slot = 4;}
else if(S1==1 && S2==1 && S3==1 && S4==1){Active_slot = 0;}
else if(S1==1 && S2==0 && S3==1 && S4==0){Active_slot = 2;}
else if(S1==1 && S2==0 && S3==1 && S4==1){Active_slot = 2;}
else if(S1==1 && S2==0 && S3==0 && S4==1){Active_slot = 2;}
else if(S1==1 && S2==1 && S3==0 && S4==1){Active_slot = 3;}
else if(S1==0 && S2==1 && S3==0 && S4==0){Active_slot = 1;}
else if(S1==0 && S2==1 && S3==1 && S4==0){Active_slot = 1;}
else if(S1==0 && S2==1 && S3==1 && S4==1){Active_slot = 1;}
else if(S1==0 && S2==1 && S3==0 && S4==1){Active_slot = 1;}
else if(S1==0 && S2==0 && S3==1 && S4==0){Active_slot = 1;}
else if(S1==0 && S2==0 && S3==1 && S4==1){Active_slot = 1;}
else if(S1==0 && S2==0 && S3==0 && S4==1){Active_slot = 1;}

if (narrative != 1 && narrative != 2 && (gb.buttons.pressed(BTN_C))){
   menu_1 ++;}

if(menu_1 == 3){
  scroll1 = 1;
  gb.display.setColor(BLACK);
  gb.display.drawBitmap(0,menuy,menu1);
  gb.display.setColor(WHITE);
  gb.display.drawBitmap(0,menuy,menu2);
  gb.display.setColor(BLACK);}


else if(menu_1 >= 5){
scroll1 =2;
gb.display.setColor(BLACK);
  gb.display.drawBitmap(0,menuy,menu1);
  gb.display.setColor(WHITE);
  gb.display.drawBitmap(0,menuy,menu2);
  gb.display.setColor(BLACK);
    }

if((menu_1 == 3 && key_1 == 3 && Active_slot==1) || (menu_1 == 5 && key_1 == 3 && Active_slot==1)){gb.display.drawBitmap(key_loc,keyy,key);}
if((menu_1 == 3 && key_1 == 3 && Active_slot==2) || (menu_1 == 5 && key_1 == 3 && Active_slot==2)){gb.display.drawBitmap(key_loc,keyy,key);}
if((menu_1 == 3 && key_1 == 3 && Active_slot==3) || (menu_1 == 5 && key_1 == 3 && Active_slot==3)){gb.display.drawBitmap(key_loc,keyy,key);}
if((menu_1 == 3 && key_1 == 3 && Active_slot==4) || (menu_1 == 5 && key_1 == 3 && Active_slot==4)){gb.display.drawBitmap(key_loc,keyy,key);}

if(keyslot==1 && gb.buttons.pressed(BTN_B)){key_1 = 5, S1 = 0, keyslot=0 ;} //////test remove item key
if(keyslot==2 && gb.buttons.pressed(BTN_B)){key_1 = 5, S2 = 0, keyslot=0 ;}
if(keyslot==3 && gb.buttons.pressed(BTN_B)){key_1 = 5, S3 = 0, keyslot=0 ;}
if(keyslot==4 && gb.buttons.pressed(BTN_B)){key_1 = 5, S4 = 0, keyslot=0 ;}

if((menu_1 == 3 && key_2 == 3 && Active_slot==1) || (menu_1 == 5 && key_2 == 3 && Active_slot==1)){gb.display.drawBitmap(key2_loc,keyy,key2);}
if((menu_1 == 3 && key_2 == 3 && Active_slot==2) || (menu_1 == 5 && key_2 == 3 && Active_slot==2)){gb.display.drawBitmap(key2_loc,keyy,key2);}
if((menu_1 == 3 && key_2 == 3 && Active_slot==3) || (menu_1 == 5 && key_2 == 3 && Active_slot==3)){gb.display.drawBitmap(key2_loc,keyy,key2);}
if((menu_1 == 3 && key_2 == 3 && Active_slot==4) || (menu_1 == 5 && key_2 == 3 && Active_slot==4)){gb.display.drawBitmap(key2_loc,keyy,key2);}

//if(keyslot2==1 && gb.buttons.pressed(BTN_B)){key_1 = 5, S1 = 0, keyslot2=0 ;} //////test remove item key
//if(keyslot2==2 && gb.buttons.pressed(BTN_B)){key_1 = 5, S2 = 0, keyslot2=0 ;}
//if(keyslot2==3 && gb.buttons.pressed(BTN_B)){key_1 = 5, S3 = 0, keyslot2=0 ;}
//if(keyslot2==4 && gb.buttons.pressed(BTN_B)){key_1 = 5, S4 = 0, keyslot2=0 ;}

if((menu_1 == 3 && sox_1 == 3 && Active_slot==1) || (menu_1 == 5 && sox_1 == 3 && Active_slot==1)){gb.display.drawBitmap(sox_loc,keyy,sox);}
if((menu_1 == 3 && sox_1 == 3 && Active_slot==2) || (menu_1 == 5 && sox_1 == 3 && Active_slot==2)){gb.display.drawBitmap(sox_loc,keyy,sox);}
if((menu_1 == 3 && sox_1 == 3 && Active_slot==3) || (menu_1 == 5 && sox_1 == 3 && Active_slot==3)){gb.display.drawBitmap(sox_loc,keyy,sox);}
if((menu_1 == 3 && sox_1 == 3 && Active_slot==4) || (menu_1 == 5 && sox_1 == 3 && Active_slot==4)){gb.display.drawBitmap(sox_loc,keyy,sox);}

//if(soxslot==1 && gb.buttons.pressed(BTN_B)){sox_1 = 5, S1 = 0;} //////test remove item sock
//if(soxslot==2 && gb.buttons.pressed(BTN_B)){sox_1 = 5, S2 = 0;}
//if(soxslot==3 && gb.buttons.pressed(BTN_B)){sox_1 = 5, S3 = 0;}
//if(soxslot==4 && gb.buttons.pressed(BTN_B)){sox_1 = 5, S4 = 0;}



if (scroll1 == 1 && menuy < 0){
  menuy = menuy + 2;    ////2 = menu speed down
  keyy = keyy + 2;}     ////2 = menu speed down
  if (scroll1 == 2 && menuy > -84){
    menuy = menuy - 2;  ////2 = menu speed up
    keyy = keyy - 2;}   ////2 = menu speed up
    if (menuy == -84 && scroll1 == 2){
      menu_1 ++;}
      if (menu_1 > 7){
       menu_1 = 1;
        scroll1 = 0;}




////PICKUP ITEMS/EMPTY LOCATIONS/////
else      if((gb.display.solid[i].spritecol == houseB3) && room == 1 && key_1 == 1) {gb.popup(F(" ""It's locked!!"" "),20); return true;}
else      if((gb.display.solid[i].spritecol == houseB3) && room == 6) {gb.popup(F(" ""It's locked!!"" "),20); return true;}


else      if((gb.display.solid[i].spritecol == chest) && room == 1 && Active_slot == 1 && gb.buttons.pressed(BTN_A) && key_1 == 1) {gb.popup(F(" ""You got key"" "),20); key_1 = 3, S1=1, key_loc=8, keyslot=1; return true;}
else      if((gb.display.solid[i].spritecol == chest) && room == 1 && Active_slot == 2 && gb.buttons.pressed(BTN_A) && key_1 == 1) {gb.popup(F(" ""You got key"" "),20); key_1 = 3, S2=1, key_loc=26, keyslot=2 ; return true;}
else      if((gb.display.solid[i].spritecol == chest) && room == 1 && Active_slot == 3 && gb.buttons.pressed(BTN_A) && key_1 == 1) {gb.popup(F(" ""You got key"" "),20); key_1 = 3, S3=1, key_loc=44, keyslot=3; return true;}
else      if((gb.display.solid[i].spritecol == chest) && room == 1 && Active_slot == 4 && gb.buttons.pressed(BTN_A) && key_1 == 1) {gb.popup(F(" ""You got key"" "),20); key_1 = 3, S4=1, key_loc=62, keyslot=4; return true;}


else      if((gb.display.solid[i].spritecol == chest) && room == 1 && gb.buttons.pressed(BTN_A) && key_1 > 1) {gb.popup(F(" ""It's empty!!"" "),20); return true;}
//else      if(gb.display.solid[i].spritecol == chest) return true;

else      if((gb.display.solid[i].spritecol == chest) && room == 5 && Active_slot == 1 && gb.buttons.pressed(BTN_A) && key_2 == 1) {gb.popup(F(" ""You got key"" "),20); key_2 = 3, S1=1, key2_loc=8, keyslot2=1; return true;}
else      if((gb.display.solid[i].spritecol == chest) && room == 5 && Active_slot == 2 && gb.buttons.pressed(BTN_A) && key_2 == 1) {gb.popup(F(" ""You got key"" "),20); key_2 = 3, S2=1, key2_loc=26, keyslot2=2 ; return true;}
else      if((gb.display.solid[i].spritecol == chest) && room == 5 && Active_slot == 3 && gb.buttons.pressed(BTN_A) && key_2 == 1) {gb.popup(F(" ""You got key"" "),20); key_2 = 3, S3=1, key2_loc=44, keyslot2=3; return true;}
else      if((gb.display.solid[i].spritecol == chest) && room == 5 && Active_slot == 4 && gb.buttons.pressed(BTN_A) && key_2 == 1) {gb.popup(F(" ""You got key"" "),20); key_2 = 3, S4=1, key2_loc=62, keyslot2=4; return true;}


else      if((gb.display.solid[i].spritecol == chest) && room == 5 && gb.buttons.pressed(BTN_A) && key_2 > 1) {gb.popup(F(" ""It's empty!!"" "),20); return true;}
else      if(gb.display.solid[i].spritecol == chest) return true;


else      if((gb.display.solid[i].spritecol == bedsidebottom) && room == 5 && Active_slot == 1 && gb.buttons.pressed(BTN_A) && sox_1 == 1) {gb.popup(F(" ""You got a sock?"" "),20); sox_1 = 3, S1=1, sox_loc=7, soxslot=1; return true;}
else      if((gb.display.solid[i].spritecol == bedsidebottom) && room == 5 && Active_slot == 2 && gb.buttons.pressed(BTN_A) && sox_1 == 1) {gb.popup(F(" ""You got a sock?"" "),20); sox_1 = 3, S2=1, sox_loc=25, soxslot=1; return true;}
else      if((gb.display.solid[i].spritecol == bedsidebottom) && room == 5 && Active_slot == 3 && gb.buttons.pressed(BTN_A) && sox_1 == 1) {gb.popup(F(" ""You got a sock?"" "),20); sox_1 = 3, S3=1, sox_loc=43, soxslot=1; return true;}
else      if((gb.display.solid[i].spritecol == bedsidebottom) && room == 5 && Active_slot == 4 && gb.buttons.pressed(BTN_A) && sox_1 == 1) {gb.popup(F(" ""You got a sock?"" "),20); sox_1 = 3, S4=1, sox_loc=61, soxslot=1; return true;}


else      if((gb.display.solid[i].spritecol == bedsidebottom) && room == 5 && gb.buttons.pressed(BTN_A) && sox_1 > 1) {gb.popup(F(" ""It's empty!!"" "),20); return true;}
else      if(gb.display.solid[i].spritecol == bedsidebottom) return true;



Edit::: ok I understand the slot layout and can probably expand it on my own. I just don't understand how the slots are located in the bubble and how to place something in the slot in the bubble.
 
Last edited:
All right my friends I need some learning.....

Ive been staring at the menu code for days now trying to acquaint myself with the code above. But I'm not really any closer to understanding how to get the items to go in the slots. Naed says in his lil tutorial that he places the key in the slot this way with 8 and 8 being the placement coordinates.

Code:
if(menu_1 == 3 && key_1 == 3){
* gb.display.drawBitmap(8,8,key);
}

But the code looks like this....

Code:
if((menu_1 == 3 && key_1 == 3 && Active_slot==1) || (menu_1 == 5 && key_1 == 3 && Active_slot==1)){gb.display.drawBitmap(key_loc,keyy,key);}
if((menu_1 == 3 && key_1 == 3 && Active_slot==2) || (menu_1 == 5 && key_1 == 3 && Active_slot==2)){gb.display.drawBitmap(key_loc,keyy,key);}
if((menu_1 == 3 && key_1 == 3 && Active_slot==3) || (menu_1 == 5 && key_1 == 3 && Active_slot==3)){gb.display.drawBitmap(key_loc,keyy,key);}
if((menu_1 == 3 && key_1 == 3 && Active_slot==4) || (menu_1 == 5 && key_1 == 3 && Active_slot==4)){gb.display.drawBitmap(key_loc,keyy,key);}

would this be the part of what tells the items go to one slot?

Code:
     if(S1==0 && S2==0 && S3==0 && S4==0){Active_slot = 1;}
else if(S1==1 && S2==0 && S3==0 && S4==0){Active_slot = 2;}
else if(S1==1 && S2==1 && S3==0 && S4==0){Active_slot = 3;}
else if(S1==1 && S2==1 && S3==1 && S4==0){Active_slot = 4;}
else if(S1==1 && S2==1 && S3==1 && S4==1){Active_slot = 0;}
else if(S1==1 && S2==0 && S3==1 && S4==0){Active_slot = 2;}
else if(S1==1 && S2==0 && S3==1 && S4==1){Active_slot = 2;}
else if(S1==1 && S2==0 && S3==0 && S4==1){Active_slot = 2;}
else if(S1==1 && S2==1 && S3==0 && S4==1){Active_slot = 3;}
else if(S1==0 && S2==1 && S3==0 && S4==0){Active_slot = 1;}
else if(S1==0 && S2==1 && S3==1 && S4==0){Active_slot = 1;}
else if(S1==0 && S2==1 && S3==1 && S4==1){Active_slot = 1;}
else if(S1==0 && S2==1 && S3==0 && S4==1){Active_slot = 1;}
else if(S1==0 && S2==0 && S3==1 && S4==0){Active_slot = 1;}
else if(S1==0 && S2==0 && S3==1 && S4==1){Active_slot = 1;}
else if(S1==0 && S2==0 && S3==0 && S4==1){Active_slot = 1;}

The only other things I see are these two bits tha could give coordinates...

Code:
else      if((gb.display.solid[i].spritecol == chest) && room == 1 && Active_slot == 1 && gb.buttons.pressed(BTN_A) && key_1 == 1) {gb.popup(F(" ""You got key"" "),20); key_1 = 3, S1=1, key_loc=8, keyslot=1; return true;}
else      if((gb.display.solid[i].spritecol == chest) && room == 1 && Active_slot == 2 && gb.buttons.pressed(BTN_A) && key_1 == 1) {gb.popup(F(" ""You got key"" "),20); key_1 = 3, S2=1, key_loc=26, keyslot=2 ; return true;}
else      if((gb.display.solid[i].spritecol == chest) && room == 1 && Active_slot == 3 && gb.buttons.pressed(BTN_A) && key_1 == 1) {gb.popup(F(" ""You got key"" "),20); key_1 = 3, S3=1, key_loc=44, keyslot=3; return true;}
else      if((gb.display.solid[i].spritecol == chest) && room == 1 && Active_slot == 4 && gb.buttons.pressed(BTN_A) && key_1 == 1) {gb.popup(F(" ""You got key"" "),20); key_1 = 3, S4=1, key_loc=62, keyslot=4; return true;}

and

Code:
if (scroll1 == 1 && menuy < 0){
  menuy = menuy + 2;    ////2 = menu speed down
  keyy = keyy + 2;}     ////2 = menu speed down
  if (scroll1 == 2 && menuy > -84){
    menuy = menuy - 2;  ////2 = menu speed up
    keyy = keyy - 2;}   ////2 = menu speed up
    if (menuy == -84 && scroll1 == 2){
      menu_1 ++;}
      if (menu_1 > 7){
       menu_1 = 1;
        scroll1 = 0;}
 
Ended up having to create a new set of functions to do the menu/inventory part. But I'm having a weird glitch. I gave the menu a set of commands to move a cursor up and down the menu bubble when its called. The problem is that when I call the menu and try to move the cursor the player moves instead. This is puzzling since the variables for both player and cursor use different sets of defines and different bitmaps. And each set of controls are packed into separate functions.

heres the cursor code for the menu....
Code:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int cursor_x = 17;       //cursor position on screen x
int cursor_y = 48;     //cursor position on screen y


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int menu_1 = 1;

struct Item{
 uint8_t x;
 uint8_t y;
 uint8_t ID;
 uint8_t S;
 bool Active;
};

const uint8_t MaxItem = 10;

const uint8_t MaxSlots = 10;

struct Item Enviroment[MaxItem];

struct Item Inventory[MaxSlots];
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
struct Slot {
  int x;
  int y;
  int w;
  int h;
  bool avail;
};
const uint8_t no_of_slots = 10;

const Slot slots[no_of_slots] = { 
  { 16, 48, 81, 16, true},
  { 16, 64, 81, 16, true},
  { 16, 80, 81, 16, true},
  { 16, 96, 81, 16, true},
  { 16, 112, 81, 16, true},
  { 16, 128, 81, 16, true},
  { 16, 144, 81, 16, true},
  { 16, 160, 81, 16, true},
  { 16, 176, 81, 16, true},
  { 16, 192, 81, 16, true},
 // { 16, 208, 81, 16 },

};
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

bool AddInv(uint8_t Item){
  bool Added = false;                 
  for(uint8_t i=0; i<  MaxSlots; i++){                             // for unsigned 8 equals 0, i is less than the max amount of slots increments i plus 2
    if((Inventory[i].ID == Item)&&(Inventory[i].S < MaxItem)){     // if inventoryis i id equals item and inventory slot is less than the max item amount
          Inventory[i].S++;                                        // increment the slot position 
          Added = true;                // <<< Was AddInv = true;   
          break;                                                   // stop operation
    }
 }

 if (!Added) {                          //<<< Was if (!AddInv) {
   for(uint8_t i=0; i<  MaxSlots; i++){
      if(Inventory[i].ID == 0){
            Inventory[i].S++;
            Inventory[i].ID = Item;
            Added = true;               //<<< Was AddInv = true;
            break;
      }
    }
  }
return Added;                          //<<< Was return AddInv;
}
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////


uint8_t getFirstAvailSlot() {

  for (uint8_t i = 0; i < no_of_slots; i++) {      ///// for unsingned 8 equals 0 i is less than the number of slot
    if (slots[i].avail == true) return i;          ///// use available slot
  }

  return 255; // Or something that signifies no slots available ..

}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void Menu(){
if (ButtonA.fallingEdge()){
            menu_1 = menu_1 + 1;}


else if(menu_1 == 3){
 tft.writeRectNBPP(16,0,114,32,4,itemmenutop,palette);
  tft.writeRectNBPP(16,32,114,16,4,itemmenu2,palette);
   tft.writeRectNBPP(16,48,114,160,4,itemmenu3,palette);
   tft.writeRectNBPP(16,208,114,16,4,itemmenu4,palette);
}

else if(menu_1 >= 5){
          menu_1 = 1;}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if (ButtonUp.fallingEdge()){
     tft.writeRectNBPP(cursor_x,cursor_y,16,16,4,cursordot2,palette);
     cursor_y -= 16;
//     if(checkcolision())
     {
      cursor_y += 16;} 
     }
     if(cursor_y <= 32){
        cursor_y = 32;}
          
//////////////////////////////////////////////////////////////////////////////
///////////////////////////////Down///////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
 if (ButtonDown.fallingEdge()){
   tft.writeRectNBPP(cursor_x, cursor_y,16,16,4,cursordot2,palette);
   cursor_y += 16;
//    if(checkcolision())
    {
    cursor_y -= 16;}
    }
    if(cursor_y >= 224){
       cursor_y = 224;}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
}

#endif

ok now here is the player code
Code:
void drawplayer() {
///////////////////////////////////////////////////////////////////////////////
////////////////////////////////camera controls////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Clamp cameraX
if(cameraX < cameraXMin)
{
  cameraX = cameraXMin;
}
else if(cameraX > cameraXMax)
{
   cameraX = cameraXMax;
}

// Clamp cameraY
if(cameraY < cameraYMin)
{
  cameraY = cameraYMin;
}
else if(cameraY > cameraYMax)
{
   cameraY = cameraYMax;  
}

// Check if player is beyond X boundary
if(player_x < playerXMin)
{
  cameraX += cameraXSpeed;
  if(cameraX > cameraXMin && cameraX < cameraXMax)
  {
    player_x = playerXMin;
  }
}
else if(player_x > playerXMax)
{
  cameraX -= cameraXSpeed;
  if(cameraX > cameraXMin && cameraX < cameraXMax)
  {
    player_x = playerXMax;
  }
}

// Check if player is beyond Y boundary
if(player_y < playerYMin)
{
  cameraY += cameraYSpeed;
  if(cameraY > cameraYMin && cameraY < cameraYMax)
  {
    player_y = playerYMin;
  }
}
else if(player_y > playerYMax)
{
  cameraY -= cameraYSpeed;
  if(cameraY > cameraYMin && cameraY < cameraYMax)
  {
    player_y = playerYMax;
  }
}
//////////////////////////////////////////////////////////////////////////////
///////////////////////////////Palette////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
 palette[0] = 0;
       palette[1] = BLACK;
             palette[2] = BLUE;
                   palette[3] = BROWN;
                         palette[4] = DARKGREEN;
                              palette[5] = GREY;
                                    palette[6] = PINK;
                                          palette[7] = RED;
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////                                                
                                           palette[8] = BEIGE;
                                     palette[9] = GREEN;
                               palette[a]= DARKGREY;
                         palette[b] = LIGHTGREY;
                   palette[c] = YELLOW; 
             palette[d] = PURPLE; 
       palette[e] = WHITE;
 palette[f] = ORANGE;
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////Tilemap/////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/////// top center rock formation
        
        if(room == 1){
  tft.drawTilemap(cameraX, cameraY, imperialbasin, spritesheet, palette);}
   else if(room == 2){
  tft.drawTilemap(cameraX, cameraY, dungeon1, spritesheet, palette);}
   else if(room == 3){
  tft.drawTilemap(cameraX, cameraY, arakeen, spritesheet, palette);}
   else if(room == 4){
  tft.drawTilemap(cameraX, cameraY, arakeen1l1, spritesheet, palette);}
   else if(room == 5){
  tft.drawTilemap(cameraX, cameraY, arakeen1l2, spritesheet, palette);}
   else if(room == 6){
  tft.drawTilemap(cameraX, cameraY, arakeen2l1, spritesheet, palette);}
   else if(room == 7){
  tft.drawTilemap(cameraX, cameraY, arakeen2l2, spritesheet, palette);}
   else if(room == 8){
  tft.drawTilemap(cameraX, cameraY, arakeen2l3, spritesheet, palette);}
   else if(room == 9){
  tft.drawTilemap(cameraX, cameraY, arakeen3, spritesheet, palette);}
   else if(room == 10){
  tft.drawTilemap(cameraX, cameraY, arakeen4l1, spritesheet, palette);}
   else if(room == 11){
  tft.drawTilemap(cameraX, cameraY, arakeen4l2, spritesheet, palette);}
   else if(room == 12){
  tft.drawTilemap(cameraX, cameraY, arakeen4l3, spritesheet, palette);}
   else if(room == 13){
  tft.drawTilemap(cameraX, cameraY, arakeen5l1, spritesheet, palette);}
   else if(room == 14){
  tft.drawTilemap(cameraX, cameraY, arakeen5b1, spritesheet, palette);}
   else if(room == 15){
  tft.drawTilemap(cameraX, cameraY, arakeen5b2, spritesheet, palette);}
   else if(room == 16){
  tft.drawTilemap(cameraX, cameraY, arakeen5l2, spritesheet, palette);}
   else if(room == 17){
  tft.drawTilemap(cameraX, cameraY, arakeen5l3, spritesheet, palette);}
   else if(room == 18){
  tft.drawTilemap(cameraX, cameraY, arakeen6l1, spritesheet, palette);}
   else if(room == 19){
  tft.drawTilemap(cameraX, cameraY, arakeen6l2, spritesheet, palette);}
   else if(room == 20){
  tft.drawTilemap(cameraX, cameraY, arakeen7, spritesheet, palette);}
   else if(room == 21){
  tft.drawTilemap(cameraX, cameraY, arakeen8, spritesheet, palette);}
   else if(room == 22){
  tft.drawTilemap(cameraX, cameraY, arakeen9, spritesheet, palette);}
   else if(room == 23){
  tft.drawTilemap(cameraX, cameraY, arakeen10, spritesheet, palette);}
   else if(room == 24){
  tft.drawTilemap(cameraX, cameraY, dungeon2, spritesheet, palette);}
   else if(room == 25){
  tft.drawTilemap(cameraX, cameraY, village2, spritesheet, palette);}
   else if(room == 26){
  tft.drawTilemap(cameraX, cameraY, village2r1, spritesheet, palette);}
   else if(room == 27){
  tft.drawTilemap(cameraX, cameraY, village2r2, spritesheet, palette);}
   else if(room == 28){
  tft.drawTilemap(cameraX, cameraY, village2r3, spritesheet, palette);}
   else if(room == 29){
  tft.drawTilemap(cameraX, cameraY, village2r4, spritesheet, palette);}
   else if(room == 30){
  tft.drawTilemap(cameraX, cameraY, village2r5, spritesheet, palette);}
   else if(room == 31){
  tft.drawTilemap(cameraX, cameraY, village2r6, spritesheet, palette);}
   else if(room == 32){
  tft.drawTilemap(cameraX, cameraY, village2r7, spritesheet, palette);}
   else if(room == 33){
  tft.drawTilemap(cameraX, cameraY, village2r8l1, spritesheet, palette);}
   else if(room == 34){
  tft.drawTilemap(cameraX, cameraY, village2r8l2, spritesheet, palette);}
   else if(room == 35){
  tft.drawTilemap(cameraX, cameraY, dungeon3, spritesheet, palette);}
   else if(room == 36){
  tft.drawTilemap(cameraX, cameraY, village3, spritesheet, palette);}
   else if(room == 37){
  tft.drawTilemap(cameraX, cameraY, village3r1, spritesheet, palette);}
   else if(room == 38){
  tft.drawTilemap(cameraX, cameraY, village3r2, spritesheet, palette);}
   else if(room == 39){
  tft.drawTilemap(cameraX, cameraY, village3r3, spritesheet, palette);}
   else if(room == 40){
  tft.drawTilemap(cameraX, cameraY, village3r4, spritesheet, palette);}
   else if(room == 41){
  tft.drawTilemap(cameraX, cameraY, village3r5, spritesheet, palette);}
   else if(room == 42){
  tft.drawTilemap(cameraX, cameraY, village3r6l1, spritesheet, palette);}
   else if(room == 43){
  tft.drawTilemap(cameraX, cameraY, village3r6l2, spritesheet, palette);}
 
///////////////////////////////////////////////////////////////////////////////
///////////////////////////Buttons Repeat//////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////  
       if (ButtonUp.update());
               if (ButtonDown.update());
                       if (ButtonLeft.update());
                             if (ButtonRight.update());
                                       if (ButtonA.update());
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
                                       ButtonUp.rebounce(10);
                               ButtonDown.rebounce(10);
                       ButtonLeft.rebounce(10);
            ButtonRight.rebounce(10);
 //    ButtonA.rebounce(10);
///////////////////////////////////////////////////////////////////////////////
////////////////////////////Up/////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
if (ButtonUp.fallingEdge()){
    tft.writeRectNBPP(player_x, player_y,16,16,4,paulrearwa,palette);
    tft.writeRectNBPP(player_x, player_y,16,16,4,paulrearwb,palette);
    player_direction = 1;
    player_y -= 4;
    if(checkcolision())
    {
        player_y += 4;} 
    }
     if(player_y <= 16){
        player_y = 16;}  

//////////////////////////////////////////////////////////////////////////////
///////////////////////////////Down///////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
if (ButtonDown.fallingEdge()){
    tft.writeRectNBPP(player_x, player_y,16,16,4,paulfrontwa,palette);
    tft.writeRectNBPP(player_x, player_y,16,16,4,paulfrontwb,palette);
    player_direction = 2;
    player_y += 4;
    if(checkcolision())
    {
       player_y -=4;}
    }
    if(player_y >= 224){
       player_y = 224;}
//////////////////////////////////////////////////////////////////////////////
//////////////////////////Left////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
if (ButtonLeft.fallingEdge()){
    tft.writeRectNBPP(player_x, player_y,16,16,4,paulleftw,palette);
    tft.writeRectNBPP(player_x, player_y,16,16,4,paulleft,palette);
    player_direction = 3;
    player_x -= 4;
    if(checkcolision())
   {
      player_x += 4;}  
   }
   if(player_x >= 304){
      player_x = 304;}    
/////////////////////////////////////////////////////////////////////////////
////////////////////////////Right////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
if (ButtonRight.fallingEdge()){
    tft.writeRectNBPP(player_x, player_y,16,16,4,paulrightw,palette);
    tft.writeRectNBPP(player_x, player_y,16,16,4,paulright,palette);
    player_direction = 4;
    player_x += 4;
  if(checkcolision())
  {
    player_x -= 4;}
  }
            if(player_x <= 16){
              player_x = 16;}
///////////////////////////////////////////////////////////////////////////////     
//////////////////////////////PLAYER DIRECTION/////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
if (player_direction == 1){
  tft.writeRectNBPP(player_x, player_y,16,16,4,paulrear,palette);
}
/////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////
else if (player_direction == 2){
   tft.writeRectNBPP(player_x, player_y,16,16,4,paulfront,palette);
}
/////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////
else if (player_direction == 3){
    tft.writeRectNBPP(player_x, player_y,16,16,4,paulleft,palette);
}
/////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////
else if (player_direction == 4){
     tft.writeRectNBPP(player_x, player_y,16,16,4,paulright,palette);
}
/////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////        
/////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////for use with movey blocks////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////
else if (player_direction == 5){
     tft.writeRectNBPP(player_x, player_y,16,16,4,paulrearwa,palette);
}     
else if (player_direction == 6){
     tft.writeRectNBPP(player_x, player_y,16,16,4,paulfrontwa,palette);
}     
else if (player_direction == 7){
     tft.writeRectNBPP(player_x, player_y,16,16,4,paulleftw,palette);
}          
else if (player_direction == 8){
     tft.writeRectNBPP(player_x, player_y,16,16,4,paulrightw,palette); 
}          
};

so how can I stop the player from moving so the cursor will move instead?
 
Status
Not open for further replies.
Back
Top