Posted Sat Jul 18, 2009 7:50 PM
Posted Fri Sep 18, 2009 9:56 PM
Edited by disjaukifa, Fri Sep 18, 2009 9:56 PM.
Posted Sat Oct 3, 2009 5:34 AM
Posted Wed Mar 10, 2010 8:22 AM
endrien, on Sat Oct 3, 2009 5:34 AM, said:
Posted Wed Mar 10, 2010 2:23 PM
Atarius Maximus, on Wed Mar 10, 2010 8:22 AM, said:
endrien, on Sat Oct 3, 2009 5:34 AM, said:
Posted Fri Mar 12, 2010 6:01 PM
Posted Wed Mar 17, 2010 10:43 PM
Posted Thu Mar 18, 2010 4:52 PM
Cliff Friedel, on Wed Mar 17, 2010 10:43 PM, said:
rem ***************************************************** rem * rem * Music Starter using data rem * rem * Based on code posted in the Ballblazer thread at AtariAge: rem * http://www.atariage.com/forums/index.php?s=&showtopic=130990&view=findpost&p=1615280 rem * rem * Code adapted by Duane Alan Hahn (Random Terrain) rem * rem * Explanation: rem * This has a 256-byte limitation. rem * rem ***************************************************** set smartbranching on rem ***************************************************** rem * Create aliases for variables rem ***************************************************** dim duration=a dim rand16=z rem ***************************************************** rem * Variable descriptions rem ***************************************************** rem * duration - how long each note plays rem * x - data counter rem * rand16 - makes better random numbers rem * Volume off AUDV0=0 AUDV1=0 rem * Initialize duration and data counter duration = 1 : x = 0 rem ***************************************************** rem * rem * Main game loop starts here. rem * rem ***************************************************** MainLoop goto GetMusic GotMusic drawscreen goto MainLoop rem ***************************************************** rem * Music rem ***************************************************** GetMusic rem * Check for end of current note duration = duration - 1 if duration>0 then GotMusic rem * Retrieve channel 0 data temp4 = musicData[x] : x = x + 1 temp5 = musicData[x] : x = x + 1 temp6 = musicData[x] : x = x + 1 rem * Check for end of data if temp4=255 then duration = 1 : x = 0 : goto GotMusic rem * Play channel 0 AUDV0 = temp4 AUDC0 = temp5 AUDF0 = temp6 rem * Retrieve channel 1 data temp4 = musicData[x] : x = x + 1 temp5 = musicData[x] : x = x + 1 temp6 = musicData[x] : x = x + 1 rem * Play channel 1 AUDV1 = temp4 AUDC1 = temp5 AUDF1 = temp6 rem * Set duration duration = musicData[x] : x = x + 1 goto GotMusic rem ***************************************************** rem * Music Data Block rem ***************************************************** rem * Format: rem * v,c,f (channel 0) rem * v,c,f (channel 1) rem * d rem * rem * Explanation: rem * v - volume (0 to 15) rem * c - control [a.k.a. tone, voice, and distortion] (0 to 15) rem * f - frequency (0 to 31) rem * d - duration data musicData 8,12,29 0,0,0 15 2,12,29 0,0,0 8 8,12,19 0,0,0 15 2,12,19 0,0,0 8 8,12,17 0,0,0 15 2,12,17 0,0,0 8 255 end goto GotMusic
Posted Thu Mar 18, 2010 10:34 PM
Random Terrain, on Thu Mar 18, 2010 4:52 PM, said:
Cliff Friedel, on Wed Mar 17, 2010 10:43 PM, said:
rem ***************************************************** rem * rem * Music Starter using data rem * rem * Based on code posted in the Ballblazer thread at AtariAge: rem * http://www.atariage.com/forums/index.php?s=&showtopic=130990&view=findpost&p=1615280 rem * rem * Code adapted by Duane Alan Hahn (Random Terrain) rem * rem * Explanation: rem * This has a 256-byte limitation. rem * rem ***************************************************** set smartbranching on rem ***************************************************** rem * Create aliases for variables rem ***************************************************** dim duration=a dim rand16=z rem ***************************************************** rem * Variable descriptions rem ***************************************************** rem * duration - how long each note plays rem * x - data counter rem * rand16 - makes better random numbers rem * Volume off AUDV0=0 AUDV1=0 rem * Initialize duration and data counter duration = 1 : x = 0 rem ***************************************************** rem * rem * Main game loop starts here. rem * rem ***************************************************** MainLoop goto GetMusic GotMusic drawscreen goto MainLoop rem ***************************************************** rem * Music rem ***************************************************** GetMusic rem * Check for end of current note duration = duration - 1 if duration>0 then GotMusic rem * Retrieve channel 0 data temp4 = musicData[x] : x = x + 1 temp5 = musicData[x] : x = x + 1 temp6 = musicData[x] : x = x + 1 rem * Check for end of data if temp4=255 then duration = 1 : x = 0 : goto GotMusic rem * Play channel 0 AUDV0 = temp4 AUDC0 = temp5 AUDF0 = temp6 rem * Retrieve channel 1 data temp4 = musicData[x] : x = x + 1 temp5 = musicData[x] : x = x + 1 temp6 = musicData[x] : x = x + 1 rem * Play channel 1 AUDV1 = temp4 AUDC1 = temp5 AUDF1 = temp6 rem * Set duration duration = musicData[x] : x = x + 1 goto GotMusic rem ***************************************************** rem * Music Data Block rem ***************************************************** rem * Format: rem * v,c,f (channel 0) rem * v,c,f (channel 1) rem * d rem * rem * Explanation: rem * v - volume (0 to 15) rem * c - control [a.k.a. tone, voice, and distortion] (0 to 15) rem * f - frequency (0 to 31) rem * d - duration data musicData 8,12,29 0,0,0 15 2,12,29 0,0,0 8 8,12,19 0,0,0 15 2,12,19 0,0,0 8 8,12,17 0,0,0 15 2,12,17 0,0,0 8 255 end goto GotMusic
Posted Wed May 26, 2010 11:03 AM
Atarius Maximus, on Wed Mar 10, 2010 2:23 PM, said:
Atarius Maximus, on Wed Mar 10, 2010 8:22 AM, said:
endrien, on Sat Oct 3, 2009 5:34 AM, said:
rem *******alternative move and fire in 8 directions + animation, variable cost = 7
rem modification saves 18 bytes adds 1 variable & fixes player reflection
rem ------------------------------------------------------------------------------------
rem Demo for moving an animated sprite that can fire a missile in any direction
rem
rem You can move around your sprite and fire in any direction.
rem
rem In trying to keep this code as short as possible, I left out the following:
rem There is no collision detection
rem There are no enemies to shoot at
rem player movement is not restricted, you can move off of the screen
rem There is no defined playfield
rem ----------------------------------------------------------------------------
rem ----------------------------------------------------------------------------
rem Variables
rem
rem I set the inital direction of the joystick to RIGHT, so when you start
rem the game for the first time you're able to fire the gun before you move
rem
rem ----------------------------------------------------------------------------
a=76 : rem player1x location
b=50 : rem player1y location
c{1}=0 : rem Turned on if the last location of the joystick was UP
c{2}=0 : rem Turned on if the last location of the joystick was DOWN
c{3}=0 : rem Turned on if the last location of the joystick was LEFT
c{4}=1 : rem Turned on if the last location of the joystick was RIGHT
c{5}=0 :rem Turned on if the last location of the joystick was UP+LEFT
c{6}=0 :rem Turned on if the last location of the joystick was UP+RIGHT
c{7}=0 :rem Turned on if the last location of the joystick was DOWN+LEFT
c{0}=0 :rem Turned on if the last location of the joystick was DOWN+RIGHT
e=20 : rem Counter for limiting travel of fired missile
w=1 : rem Used to determine player reflection (REFP1)
rem y is the animation counter
rem t replaces the still function from original code
rem ---------------------------------------------------------------------------------
start
rem reset animation control flag
t = 0
rem if reflection is switched 'on' by the w variable this keeps it in place
if w=0 then REFP1 = 8
if w=1 then REFP1 = 0
rem ---------------------------------------------------------------------------------
rem This section sets a value for the last direction the joystick was pushed
rem
rem This determines the direction the bullet will be fired later, and also
rem allows you to keep firing the bullet in the same direction after you
rem have stopped moving.
rem
rem Each time you move, each of the eight possible directions of the joystick is
rem marked as on or off with a bit variable.
rem ---------------------------------------------------------------------------------
drawscreen
if joy0up then c{1}=1:c{2}=0:c{3}=0:c{4}=0:c{5}=0:c{6}=0:c{7}=0:c{0}=0
if joy0down then c{1}=0:c{2}=1:c{3}=0:c{4}=0:c{5}=0:c{6}=0:c{7}=0:c{0}=0
if joy0left then c{1}=0:c{2}=0:c{3}=1:c{4}=0:c{5}=0:c{6}=0:c{7}=0:c{0}=0
if joy0right then c{1}=0:c{2}=0:c{3}=0:c{4}=1:c{5}=0:c{6}=0:c{7}=0:c{0}=0
if joy0up && joy0left then c{1}=0:c{2}=0:c{3}=0:c{4}=0:c{5}=1:c{6}=0:c{7}=0:c{0}=0
if joy0up && joy0right then c{1}=0:c{2}=0:c{3}=0:c{4}=0:c{5}=0:c{6}=1:c{7}=0:c{0}=0
if joy0down && joy0left then c{1}=0:c{2}=0:c{3}=0:c{4}=0:c{5}=0:c{6}=0:c{7}=1:c{0}=0
if joy0down && joy0right then c{1}=0:c{2}=0:c{3}=0:c{4}=0:c{5}=0:c{6}=0:c{7}=0:c{0}=1
rem ------------------------------------------------------------------
rem Set color of player sprites and missiles
rem ------------------------------------------------------------------
COLUP1=28
COLUP0=28
rem ------------------------------------------------------------------
rem Set initial location of player sprite
rem ------------------------------------------------------------------
player1x=a:player1y=b
rem ------------------------------------------------------------------
rem Increase 20 to a larger number to make the bullets travel farther
rem ------------------------------------------------------------------
e=e+1
if e>20 then e=0
rem ------------------------------------------------------------------
rem Player Movement
rem ------------------------------------------------------------------
rem t control variable added to advance animation counter, w ties to reflection
if joy0up then b=b-1 : t = 1
if joy0down then b=b+1 : t = 1
if joy0left then a=a-1 : t = 1 : w = 0
if joy0right then a=a+1 : t = 1 : w = 1
if !joy0fire then missile0x=0:missile0y=0:e=0
rem diagonal shots
if joy0fire && c{0} then missile0x=player1x+7+e:missile0y=player1y-3+e
if joy0fire && c{5} then missile0x=player1x-e:missile0y=player1y-7-e
if joy0fire && c{7} then missile0x=player1x-e:missile0y=player1y+1+e
if joy0fire && c{6} then missile0x=player1x+7+e:missile0y=player1y-7-e
rem left and right shots
if joy0fire && c{3} then missile0x=player1x-e:missile0y=player1y-5
if joy0fire && c{4} then missile0x=player1x+8+e:missile0y=player1y-5
rem up and down shots
if joy0fire && c{1} then missile0x=player1x+5:missile0y=player1y-10-e
if joy0fire && c{2} then missile0x=player1x+5:missile0y=player1y+3+e
rem if not moving go to player1 standing position
if !joy0up && !joy0down && !joy0left && !joy0right then y=10
rem t is the keytrap tied to joy0 directional movement if active advances animation
if t = 1 then y=y+1
rem ------------------------------------------------------------------
rem Player Animation
rem Y is the counter for the player animation. You can change the
rem animation rate by changing the 30,20,10 to a different
rem sequence of numbers.
rem ------------------------------------------------------------------
if y=30 then player1:
000110
100100
110100
011000
000000
%10011110
%01100100
010000
011000
111100
011000
end
if y=20 then player1:
%01000000
%01100011
110110
011100
101000
111100
100100
010000
011000
111100
011000
end
if y=10 then player1:
011100
011000
011000
100000
%01011010
%01111100
100100
010000
011000
111100
011000
end
rem if animation counter reaches 30 reset it
if y>30 then y=0
rem repeat loop
goto start
Posted Mon Jun 13, 2011 11:31 AM
Posted Tue Jul 26, 2011 9:43 AM
Posted Mon Apr 30, 2012 11:11 AM
0 members, 1 guests, 0 anonymous users