Jump to content
IGNORED

Never mind.


Recommended Posts

Here is a nice example program from Page 6 Magaine of a Joystick draw program that you might use as a starting point

http://www.atarimania.com/mags/pdf/page-6-issue-29.pdf

;-)

What page is it on?

What I'm trying to do is a simple program where you move left to right and catch falling hearts in a circle.

Link to comment
Share on other sites

I tried the S=STICK(0) and it didn't get me anywhere. So this is what I have so far:

 

9 CLS : SETCOLOR 2,19,12 : SETCOLOR 1,10,2 : V=40
10 X=RAND(20) : Y=1
11 POSITION X,Y: PRINT "0"
12 Z=Z+1 : IF Z=V THEN Z=0 : Y=Y+1 : IF Y=15 THEN GOTO 10
13 POSITION A,20: PRINT "V" POKE 752,1 : GOTO 11

 

Instead of a 0, I want it to print a heart. I know it can print hearts because I saw it do it when I said PUT 0. Also, I want to make the mouth (V) move, but I can't because the S=STICK(0) thing won't work, This is what I tried with it:

 

0 S=STICK(0) : IF S=11 THEN X=X+1 : IF S=7 THEN X=X-1

Nada.

Edited by atari2600land
Link to comment
Share on other sites

Here's some info on using characters like the heart symbol http://www.atariarchives.org/basicxl/showpage.php?page=363

 

If you are using the default GRAHPICS 0 text screen then add a semicolon after your PRINT "O"; and the PRINT "V"; this will stop the cursor dropping down a line and moving any existing text.

 

Atari BASIC doesn't allow you to have another IF after the first one (unless the first one is true) so put them on separate lines.

If you are using TURBO-BASIC you can add an ENDIF after the first one and then the second IF will run regardless of the first one being true.

Make sure the joystick movement check is in you main loop of code otherwise it will only be ran once!

 

I can't see where you are setting a value for A so it will be zero.

 

Remember the left most column is zero and the right most is 39. Y runs from zero to 23.

 

Making the start is the hardest bit so well done so far :thumbsup:

 

p.s. it was Page 74 "Tutorial Subroutines"

Link to comment
Share on other sites

  • 2 weeks later...

Simple tests like that can be handled by boolean logic.

Also, left/right stick directions are also reflected in the PTRIG state.

 

That allows some shortcuts like:

X=X+PTRIG(0)-PTRIG(1)

S=STICK(0) : Y=Y+(S=13)-(S=14)

Edited by Rybags
  • Like 1
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...