# lil' puzzle for ya

 Sami_Tervo in my project there is a little problem in combat walking system (= the range you can walk is defined by action points you have).at first time when i programmed that, it went quite good. when player wanted to go to place B, i subtracted amount of required action points of current action points. although there was a problem. if player hits to other object or block of somekind, he stops but he "lost" some action points coz he didnt managed to travel distance he planned. and subtracting action points after he has reached the destination, offered many ways to cheat.so i tried to program system which subtracts little bit action points in every cycle and it failed. i uploaded that to net if someone of you could take a look and tell how solve the problem.combat walking-code is in logic.123DOS-Versionhttp://koti.mbnet.fi/sterv/aqd.zipWIN-Versionhttp://koti.mbnet.fi/sterv/aqw.zipplease help! Andrew_Baker What I had in mind was more of a step-by-step AP subtraction with the keypad.if(isset(f60)){ // If movement flag is on get.posn(o0,v40,v41); if ((new_ego_x>v40 || new_ego_xv41 || new_ego_yv40 || new_ego_xv41 || new_ego_y= v193){ set.text.attribute(15,0); display(19,37,"%v193"); } else{ set.text.attribute(15,0); display(19,37,"-"); } } // Movement if(mouse_button == 1 && isset(f50) && isset(f41) && !isset(f60) && !isset(f99)) { v29 -= 8; reposition.to.v(o10,v28,v29); distance(o0,o10,v193); reposition.to(o10,1,1); set.text.attribute(0,0); display(19,37," "); if(v191 >= v193){ v62=v193; set(f99); set(f60); v63=v28; v64=v29; set.text.attribute(15,0); display(19,37,"%v193"); move.obj.v(o0, v28, v29, 2, f255); } else{ set.text.attribute(15,0); display(19,37,"-"); } }}return(); Sami_Tervo :P okie...i defined variables, objects and flags for logic.123...get it from :http://koti.mbnet.fi/sterv/defines.txt