Jump to content
BenMcLean

Can't do more than one pfread on a line?

Recommended Posts

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 by bogax
  • Like 1

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 by BenMcLean

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...