Jump to content
IGNORED

Go To Your Room!


atari2600land

Recommended Posts

While taking a break from Halloween Havoc, I tried to make an Adventure-styled world. But I've run into a bit of a snag because it won't recognize rooms 7-9 as actual rooms (see code), even though they have exactly the same coding as the other rooms. Why is this? Here's a map of the world (it's a small world, after all)

post-9475-1183267953_thumb.png

b equalling 1 or 2 is for programming purposes.

adv.bas

Link to comment
Share on other sites

it won't recognize rooms 7-9

There were two problems:

 

(1) b wasn't always being set to 1 or 2 whenever you switched areas, and

 

(2) the order of some of the ifs caused a to be updated more than once.

 

A simple way to fix (2) would be to just add a goto at the end of each if to jump over the other ifs, but I was able to correct it by just rearranging them a bit.

 

Michael

adv.bas

adv.bas.bin

Link to comment
Share on other sites

  • 2 weeks later...

OK, now suppose I want player0 to appear in a random room. I tried this:

	player0:
11110
end

decide_c
c=rand
if c=0 then goto decide_c
if c>10 then goto decide_c
if c=1 then goto decide_d
if c=2 then d=1 : goto main
if c=3 then d=1 : goto main
if c=4 then d=2 : goto main
if c=5 then d=2 : goto main
if c=6 then goto decide_d
if c=7 then d=1 : goto main
if c=8 then d=2 : goto main
if c=9 then goto decide_d
goto main

decide_d
d=rand
if d>128 then d=1
if d<=128 then d=2

 

 

and then put

if a=c && b=d then player0x=e : player0y=f (e and f are two values I determined

at the start of the game)

but if it appeared at all, it would only be in a few of them. What am I doing

wrong?

Edited by atari2600land
Link to comment
Share on other sites

I figured out that problem. :dunce: I shouldn't be thinking when it's too hot. But now I have a new problem: Mr. Enemy Block is showing up at the top when he's supposed to be in the center of the screen. I think the problem lies in the get_g part. I think I got confused because there's no drawscreen and I'm trying to get a sprite to appear, and well, here.

adv3.bas

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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...