|
Well yeah, I get that. It looks complicated, but at the heart of it, it is probably really simple; the various Pokemon just make it look confusing, like you said, everything really just revolves around the algorithms. Oh, and I thought this was funny. When you are walking through the tall grass, here is the previous code for checking to draw an overlay between the top and bottom halves of the "Ash" character: if (image_shado = 0) { if (place_snapped(16,16)) { if (place_meeting(x,y,obj_grass)) { draw_sprite(spr_ash_e,0,x,y); } } else if (!place_snapped(16,16)) { if (place_meeting(grid_xsnap,grid_ysnap,obj_grass)) { draw_sprite(spr_ash_e,0,grid_xsnap,grid_ysnap); } if (y < grid_ysnap) { if (place_meeting(grid_xsnap,grid_ysnap - 16,obj_grass)) { draw_sprite(spr_ash_e,0,grid_xsnap,grid_ysnap - 16); } } else if (y > grid_ysnap) { if (place_meeting(grid_xsnap,grid_ysnap + 16,obj_grass)) { draw_sprite(spr_ash_e,0,grid_xsnap,grid_ysnap + 16); } } else if (x < grid_xsnap) { if (place_meeting(grid_xsnap - 16,grid_ysnap,obj_grass)) { draw_sprite(spr_ash_e,0,grid_xsnap - 16,grid_ysnap); } } else if (x > grid_xsnap) { if (place_meeting(grid_xsnap + 16,grid_ysnap,obj_grass)) { draw_sprite(spr_ash_e,0,grid_xsnap + 16,grid_ysnap); } } } }
Here is the new code after I put in a new variable to simplify things: if (place_meeting(grid_xsnap,grid_ysnap,obj_grass)) { draw_sprite(spr_ash_e,0,grid_xsnap,grid_ysnap); }
if (place_meeting(grid_xnext,grid_ynext,obj_grass)) { draw_sprite(spr_ash_e,0,grid_xnext,grid_ynext); } Having the grid_xnext and grid_ynext variables actually led to being better able to handle upcoming surfing actions; I reworked the "Ash" code a bit and plan on having a "Surf" character that has "Ash" as its parent so that I do not have to go into "Ash" and over-complicate it with code that will obviously have no chance of being checked on land. More about the menu system, I could have put one in that had stock images set up, but doing this draws too much on store resources and is inefficient. Rather than doing that, I would rather figure out the workings of doing it right first. lol, yeah, once the menu,text, and item inventory engines are done, the battle engine will be pretty simple besides the aforementioned algorithms.
Logged
|