5Fermer7
VasiliyFamiliyaLe 28/03/2019 à 11:13
Now this engine is restructed for a mix of visual novel, RPG, point'n'klick adventure, and date- or life-sim (Inspired by few relatively old concept artworks - 1, 2 - of hentai mangaka nicknamed Chinbotsu, and also by MLP and Super Drags: Red Band Slayage cartoon series).
At present I trying to make the NPCs sprites to behave as a solid objects interfering player's movement during the collision (this might be very useful in Shaman King also), but for now I'm not very successful in this thing.
I used this way to create the "barrier" around every NPC:
if((p1&JOY_UP)&&y>=176) { if(((y-RoxyY>=16)&&(RoxyX-x>=16)&&(x-RoxyX>=16))&&((y-GyaruY>=16)&&(GyaruX-x>=16)&&(x-GyaruX>=16))) { y--; } } if((p1&JOY_DOWN)&&y<=220) { if(((RoxyY-y>=16)&&(RoxyX-x>=16)&&(x-RoxyX>=16))&&((GyaruY-y>=16)&&(GyaruX-x>=16)&&(x-GyaruX>=16))) { y++; } } if((p1&JOY_LEFT)&&x>=32) { if(((x-RoxyX>=16)&&(y-RoxyY>=16)&&(RoxyY-y>=16))&&((x-GyaruX>=16)&&(y-GyaruY>=16)&&(GyaruY-y>=16))) { x--; } flipMode|=FLIP_X; aSpriteSetFlip(&demoSpr,flipMode); } if((p1&JOY_RIGHT)&&x<=288) { if(((RoxyX-x>=16)&&(y-RoxyY>=16)&&(RoxyY-y>=16))&&((GyaruX-x>=16)&&(y-GyaruY>=16)&&(GyaruY-y>=16))) { x++; } flipMode&=~FLIP_X; aSpriteSetFlip(&demoSpr,flipMode); }if((p1&JOY_UP)&&((y<=112)&&(y>0))) { if(((y-RoxyY>=16)&&(RoxyX-x>=16)&&(x-RoxyX>=16))&&((y-GyaruY>=16)&&(GyaruX-x>=16)&&(x-GyaruX>=16))) { scrl_y--; } } if((p1&JOY_DOWN)&&((y>=208)&&(y<224))) { if(((RoxyY-y>=16)&&(RoxyX-x>=16)&&(x-RoxyX>=16))&&((GyaruY-y>=16)&&(GyaruX-x>=16)&&(x-GyaruX>=16))) { scrl_y++; } } if((p1&JOY_LEFT)&&((x<=32)&&(x>0))) { if(((x-RoxyX>=16)&&(y-RoxyY>=16)&&(RoxyY-y>=16))&&((x-GyaruX>=16)&&(y-GyaruY>=16)&&(GyaruY-y>=16))) { scrl_x--; if (scrl_x>FRONT_MIN_X) { RoxyX++; GyaruX++; } } } if((p1&JOY_RIGHT)&&((x>=288)&&(x<320))) { if(((RoxyX-x>=16)&&(y-RoxyY>=16)&&(RoxyY-y>=16))&&((GyaruX-x>=16)&&(y-GyaruY>=16)&&(GyaruY-y>=16))) { scrl_x++; if (scrl_x<FRONT_MAX_X) { RoxyX--; GyaruX--; } } }But in practice the player's character is just stupidly "stuck".

Can you advice me a more smart way to relize a solid objects in the game?