Jump to content

Photo

Need Help With A Skiing Game


13 replies to this topic

#1 VGAGuy OFFLINE  

VGAGuy

    Space Invader

  • 28 posts
  • Avid Bankswitcher

Posted Fri Apr 21, 2017 8:23 PM

I am trying to make an Atari 2600 skiing game that uses the paddle but am running into some problems.

 

1 I can't figure out how to make slalom hit detection work right, VBB doesn't like if then statements that are triggered by other if thens (ex: if x = 1 then if b = 4 then score = score + 1)

 

2 I can't get  the flag to reset to just above the visible screen, or even the top, the flag just peeks up from the bottom occasionally. (FIXED)

 

3 making the flag go to a random x position between 16 and 124

 

4 PADDLES DON'T WORK AT ALL! ( I could use the joystick but it would make the game less unique)

 

5 My playfield type title screen and game over are messed up due to the multisprite kernel but I wan't to keep this 8K or under, is there a way to make this work?

 

I would like to get it working before PRGE so I could possibly submit it to see if it is a good enough game,  I am trying to fit it in 4K.

 

 

P.S. Sorry for making another topic so close to another one of mine, it's just that I couldn't re-purpose the other topic.

 

P.P.S. Here is the code, my main issues are the paddles, the random x axis positioning, the sound to some degree and the PADDLES.

 

Attached File  SKI.bas   3.01KB   22 downloads

 


Edited by VGAGuy, Sat Apr 22, 2017 12:29 AM.


#2 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 28,021 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Fri Apr 21, 2017 11:53 PM

P.P.S. I will work on getting a BAS file soon.


Good. Looking at the code is better than trying to guess at the problem. Almost every time I've had a problem, it was because of some stupid little thing I overlooked.



#3 ZylonBane OFFLINE  

ZylonBane

    River Patroller

  • 3,845 posts
  • Location:KC, KS, USA

Posted Sat Apr 22, 2017 12:28 AM

1 I can't figure out how to make slalom hit detection work right, VBB doesn't like if then statements that are triggered by other if thens (ex: if x = 1 then if b = 4 then score = score + 1)

 

IF THEN THEN is nonsense syntax that wouldn't work in any BASiC dialect. Conditional code blocks are explained in the BB documentation.

 

http://www.randomter...ommands.html#if



#4 bogax OFFLINE  

bogax

    Dragonstomper

  • 705 posts

Posted Sat Apr 22, 2017 12:17 PM

 
 I don't know about VBB but bB its self doesn't have any trouble with
 
 
 if x = 1 then if b = 4 then score = score + 1
 
 
 however
 
 
 if x = 1 && b = 4 then score = score + 1 
 
 
 produces exactly the same code
 
 
 
 for a random number between 16..124
 you need a random number 0..108 + 16
 
 108 = 12 * 9
 rand produces numbers 0..255
 and you are limited to numbers 0..255 in a byte
 and you'd like to keep as many bits as possible for accuracy
 9 is 8 + 1
 12 is 1.5 * 8
 
 temp1 = rand & 127 will give you (approximately) 1 * 128
 then
 temp1 = temp1/2 + temp1 will give you (approximately) 0..192 = 1.5 * 128  =  12 * 16
 16 = 2 * 8 so now
 temp1 = (temp1/8 + temp1)  =  ((12 * 16 / 8) + 12 * 16)  =  12 * (16 / 8 + 16)  =  12 * (1 + 8) * 2  =  12 * 9 * 2  =  108 * 2
 
 so
 
 
 temp1 = rand & 127 : temp1 = temp1/2 + temp1 : temp1 = (temp1/8 + temp1)/2 + 17
 
 
 due to starting with 127 instead of 128 (max) and rounding, the numbers will be 17..123
 due to the limited accuracy the distribution may not be as nice as you'd like
 
 if you realy want 16..124 then its 127 * 109/127
 which would be something like this
 
 
 temp1 = rand/2 : temp1 = ((((temp1/4 + temp1)/2 + temp1)/4 + temp1)/2 + temp1)/2 + 16
 
 
 in this case rand/2 gives you essentially the same as rand & 127
 
 
 you've got redundant if statements eg
 
 
 if pfscore1 = 0 then AUDV0 = 0
 if pfscore1 = 0 then AUDV1 = 0
 
 
 could be done this way
 
 
 if pfscore1 = 0 then AUDV0 = 0 : AUDV1 = 0
 
 
 and doing assignments to the same value consecutively on the same line saves you something
 it loads 0 into the accumulator and then stores it to AUDV0, if it's done consecutively on the same line
 bB won't load 0 again for the store to AUDV1 since 0 is already in the accumulator. it'll just store to AUDV1
 
 it could also be written like this
 
 
 if !pfscore1 then AUDV0 = 0 : AUDV1 = 0
 
 
 
 which also saves you something. because of the way bB and the processor work it doesn't do an explicit compare to zero
 
 
 
 
 you still didn't show your paddle code
 
 
 I suspect the scoring is not working the way you'd like
 

Edited by bogax, Sat Apr 22, 2017 12:27 PM.


#5 VGAGuy OFFLINE  

VGAGuy

    Space Invader

  • Topic Starter
  • 28 posts
  • Avid Bankswitcher

Posted Sat Apr 22, 2017 3:43 PM

The Paddle code is removed so it would compile.

 just put currentpaddle = 0 before the drawscreen in the game loop

and player0x = paddle * 2 + 1 after the drawscreen

 

Yes scoring works but it only scores when you hit the flags directly but not when you go between them.



#6 SpiceWare OFFLINE  

SpiceWare

    Quadrunner

  • 11,210 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Sat Apr 22, 2017 4:42 PM

By paddles don't work do you mean on real hardware, or in Stella?

If in Stella you have to "plug in the paddles" because games default to joysticks unless Stella's been told its a paddle game. You can find instructions on how to do that in the first post of my Medieval Mayhem topic.



#7 bogax OFFLINE  

bogax

    Dragonstomper

  • 705 posts

Posted Sat Apr 22, 2017 5:18 PM

it looks to me like the multisprite kernel doesn't have the paddle code

 

there may not be time to do both sprite multiplexing and paddle reading



#8 VGAGuy OFFLINE  

VGAGuy

    Space Invader

  • Topic Starter
  • 28 posts
  • Avid Bankswitcher

Posted Sat Apr 22, 2017 6:03 PM

I can't win.



#9 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 28,021 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sat Apr 22, 2017 6:30 PM

I can't win.

 
Maybe this needs to be put in bold on the bB page:
 
Currently the options only apply to the standard kernel.
 
randomterrain.com/atari-2600-memories-batari-basic-commands.html#kerneloptions



#10 VGAGuy OFFLINE  

VGAGuy

    Space Invader

  • Topic Starter
  • 28 posts
  • Avid Bankswitcher

Posted Sat Apr 22, 2017 6:37 PM

Yeah I checked that after the previous post and did a facepalm.

I am going to have to change the game to use the joystick then, or make it a game where you collect the flags instead of it being a slalom.

Thanks for the help, also the random positioning is working now.  I'll try to work on the miss detection now.



#11 SpiceWare OFFLINE  

SpiceWare

    Quadrunner

  • 11,210 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Sun Apr 23, 2017 7:36 AM

I am going to have to change the game to use the joystick then, or make it a game where you collect the flags instead of it being a slalom.

 

Or switch your project to assembly.



#12 KaeruYojimbo OFFLINE  

KaeruYojimbo

    Stargunner

  • 1,216 posts
  • Location:Portland, OR

Posted Sun Apr 23, 2017 10:22 AM

Yeah I checked that after the previous post and did a facepalm.

I am going to have to change the game to use the joystick then, or make it a game where you collect the flags instead of it being a slalom.

Thanks for the help, also the random positioning is working now.  I'll try to work on the miss detection now.

 

Maybe I'm missing something, but is there a reason you aren't using NUSIZ1 to double the flag sprite? You'd have less control of the spacing, but it would remove the flicker and allow you to use the standard kernel and paddles (unless you plan on adding more obstacles using the multisprite kernel).



#13 VGAGuy OFFLINE  

VGAGuy

    Space Invader

  • Topic Starter
  • 28 posts
  • Avid Bankswitcher

Posted Sun Apr 23, 2017 11:06 AM

Reads NUISZ0 description...proceeds to facepalm again.

Thanks, I really need to take the time and read the entire thing.

I might keep the game as it is because the collision works properly but I might experiment with NUISZ0 and NUISZ1.



#14 ZylonBane OFFLINE  

ZylonBane

    River Patroller

  • 3,845 posts
  • Location:KC, KS, USA

Posted Sun Apr 23, 2017 7:46 PM

It's "NUSIZ", not "NUISZ".

 

NU SIZ = "new size"... get it?






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users