Jump to content
IGNORED

IntyBasic: Problem with left


atari2600land

Recommended Posts

OK, so I'm making this game here. After the title screen, the sprite is supposed to be at the lower left side of the screen and is not supposed to be moving until the player presses the disc in a direction. Instead, what happens is the sprite comes out of the lower right side of the screen and moves left automatically. I don't know why this is happening. If I get rid of "if cont1.left then dir=1" then everything works ok, except I can't move left. So apparently I must be a total idiot. Also, I don't have very much code as you can see, but it's already up to 3k. I'm wondering if I can even make a full-fledged game out of this. I assume from what I've read, I can go up to 16k.

gosub.bas

Link to comment
Share on other sites

dirbits= peek(511) AND $ff
	temp = dirbits/16
	if temp > 9 then print at 30, (temp + 23) * 8 + 6 else print at 30, (temp + 16) * 8 + 6

	temp = dirbits AND $0f
	if temp > 9 then print (temp + 23) * 8 + 6 else print (temp + 16) * 8 + 6

If you put these lines in your main loop, they will display the direction code as seem by the basic program.

 

 

Edited by catsfolly
Link to comment
Share on other sites

I wondering if it is more a emulator/windows issue. I sometimes get it as well. I have a title screen, an instructions screen, then the game. Sometimes I will press a button on the title and it will go straight thru to the games screen after displaying the instructions screen for a few frames. I have waits in the proper places which should be denouncing the controller or clearing the keyboard buffer. I'll have to try a different emulator. I can't wait until I get my hands on an LTOFlash! device.

Link to comment
Share on other sites

OK, another thing I found is the problem happens when I press the ENTER on the numbers part (the right hand side) of the keyboard. It doesn't happen if I press the right SHIFT button on my keyboard.

 

Ok, that's the problem.

 

When pressing any key from pad, the Intellivision generates the code using the bits from buttons AND directions.

 

I'm afraid there isn't a way to separate it, except to put a small delay (anti-bouncing) after your title screen in order to allow the user to release the Enter key before entering in your main loop.

Link to comment
Share on other sites

Well then I don't know what to do. Perhaps I need a better version of jzintv? I have 1.0 beta 4. By the way, it's supposed to be a submarine. I can't draw. I want the sub to move when the disc is not pressed, though.

 

Try

submarine:
BITMAP "00001100"
BITMAP "00001000"
BITMAP "00001100"
BITMAP "10111110"
BITMAP "11111111"
BITMAP "11111111"
BITMAP "11111111"
BITMAP "01111110"
And maybe double wide the sprite
SPRITE 0,X1+$300+MB_X_XSIZE,Y1+$100,$0807
Another tip is to include this set of constants from one of the examples to make your life easier
REM some Intellivision hardware constants
CONST BACKTAB = $0200
CONST CS_GRAM = $0800 ' get picture from gram
CONST CS_CARD = $01f8 ' gram or grom card number
CONST MB_X_XPOS = $00FF ' mask for x pos
CONST MB_X_INTR = $0100 ' enable collision regs
CONST MB_X_VIS = $0200 ' make mob visible
CONST MB_X_XSIZE = $0400 ' double size in x
CONST MB_Y_YPOS = $007F ' mask for y pos
CONST MB_Y_YRES = $0080 ' 16 bits in y
CONST MB_Y_YSIZ2 = $0100 ' double y size
CONST MB_Y_YSIZ4 = $0200 ' 4 times y size
CONST MB_Y_YSIZ8 = $0300 ' 8 times y size
CONST MB_Y_XFLIP = $0400 ' x flip
CONST MB_Y_YFLIP = $0800 ' y flip
CONST MB_A_GRAM = $0800 ' get picture from gram
CONST MB_A_CARD = $07f8 ' mask for picture no.
CONST MB_A_PRIO = $2000 ' priority (above/below bkgnd)
REM colors for color stack, border, etc
CONST C_BLK = $0 ' Black
CONST C_BLU = $1 ' Blue
CONST C_RED = $2 ' Red
CONST C_TAN = $3 ' Tan
CONST C_DGR = $4 ' Dark Green
CONST C_GRN = $5 ' Green
CONST C_YEL = $6 ' Yellow
CONST C_WHT = $7 ' White
CONST C_GRY = $8 ' Grey
CONST C_CYN = $9 ' Cyan
CONST C_ORG = $A ' Orange
CONST C_BRN = $B ' Brown
CONST C_PNK = $C ' Pink
CONST C_LBL = $D ' Light Blue
CONST C_YGR = $E ' Yellow-Green
CONST C_PUR = $F ' Purple
rem colors for backtab or mob a
CONST X_BLK = $0 ' Black
CONST X_BLU = $1 ' Blue
CONST X_RED = $2 ' Red
CONST X_TAN = $3 ' Tan
CONST X_DGR = $4 ' Dark Green
CONST X_GRN = $5 ' Green
CONST X_YEL = $6 ' Yellow
CONST X_WHT = $7 ' White
CONST X_GRY = $1000 ' Grey
CONST X_CYN = $1001 ' Cyan
CONST X_ORG = $1002 ' Orange
CONST X_BRN = $1003 ' Brown
CONST X_PNK = $1004 ' Pink
CONST X_LBL = $1005 ' Light Blue
CONST X_YGR = $1006 ' Yellow-Green
CONST X_PUR = $1007 ' Purple
  • 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...