BenMcLean #1 Posted September 3, 2014 I get a syntax error when I try to do more than one pfread in an if-then statement. What's going on with that and how can I fix it? default.bas Quote Share this post Link to post Share on other sites
bogax #2 Posted September 3, 2014 (edited) I think bB is just too simple to understand that. try this if joy0up && heroY > _Edge_Top && !pfread(mytemp1, mytemp2) then if !pfread(mytemp3, mytemp2) then heroY = heroY - 1 Edited September 3, 2014 by bogax 1 Quote Share this post Link to post Share on other sites
+Gemintronic #3 Posted September 3, 2014 Another method is to nest one if-then statement into another. Whatever works! set smartbranching on set romsize 4k scorecolor = $0E main if !pfread(0, 0) then if !pfread(1, 1) then score = 999 COLUBK = $4E drawscreen goto main Quote Share this post Link to post Share on other sites
BenMcLean #4 Posted September 3, 2014 (edited) I must have made a typo when I had already tried what you were suggesting before I posted because the method you suggested works now. Thanks. I finally got playfield collision prevention working, albeit with the rule that all horizontal surfaces in my playfield must be at least 2 blocks long to prevent moving through them vertically. (since I'm only pfreading the edges of the player's box facing the direction the player is moving in, and the player's box is wider than a single playfield block) default.bas Now the tricky part is going to be collision prevention and pathfinding for the enemies. ^_^ Edited September 3, 2014 by BenMcLean Quote Share this post Link to post Share on other sites