Rabbit 2600 Posted June 17, 2013 Share Posted June 17, 2013 how do you make the playfield change color when a counter goes up. Like if t = 1 that's $20. If t = 2 then pfcolor = $50 etc Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted June 18, 2013 Share Posted June 18, 2013 Do you want to change the color of the background or the playfield pixels? Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted June 18, 2013 Author Share Posted June 18, 2013 Playfield pixels. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted June 18, 2013 Share Posted June 18, 2013 Playfield pixels. You could use data, but you'll probably want to use if-thens to keep it simple for now. You'd have your counter increase by one (variable = variable + 1) and if your counter equals the number you want, you'd use COLUPF = (whatever color you want). You'd just have a handful of if-thens, similar to how you do it for an animation with if-then. Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted June 18, 2013 Author Share Posted June 18, 2013 Aha =) Gonna try it out and see if I can it going. Quote Link to comment Share on other sites More sharing options...
SeaGtGruff Posted June 18, 2013 Share Posted June 18, 2013 Here's an example using a data array. In this example a frame counter (a) is incremented every frame, then after 60 frames (1 second) the color counter (t) is incremented. If the color counter reaches 16 it gets reset, because the data array in this example has only 16 values in it. t = 0 : a = 0 : rem in this example a is a frame counter playfield: ....XXXX....XXXX....XXXX....XXXX XXXX....XXXX....XXXX....XXXX.... ....XXXX....XXXX....XXXX....XXXX XXXX....XXXX....XXXX....XXXX.... ....XXXX....XXXX....XXXX....XXXX XXXX....XXXX....XXXX....XXXX.... ....XXXX....XXXX....XXXX....XXXX XXXX....XXXX....XXXX....XXXX.... ....XXXX....XXXX....XXXX....XXXX XXXX....XXXX....XXXX....XXXX.... ....XXXX....XXXX....XXXX....XXXX end loop COLUPF = playfieldcolor[t] drawscreen a = a + 1 if a = 60 then a = 0 : t = t + 1 if t = 16 then t = 0 goto loop data playfieldcolor $08,$18,$28,$38,$48,$58,$68,$78,$88,$98,$A8,$B8,$C8,$D8,$E8,$F8 end playfieldcolor.bas playfieldcolor.bas.bin Quote Link to comment Share on other sites More sharing options...
Cybearg Posted June 18, 2013 Share Posted June 18, 2013 (edited) If the color values you're using have a specific pattern like those above, you could do something like: counter = counter + 1 temp1 = counter & 15 COLUPF = 4 + temp1 This would flip through all colors of the second-darkest color value (82, 98, etc.). Another example, which mimics what SeagtGruff's code does, would be: t = 0 : a = 0 : rem in this example a is a frame counter playfield: ....XXXX....XXXX....XXXX....XXXX XXXX....XXXX....XXXX....XXXX.... ....XXXX....XXXX....XXXX....XXXX XXXX....XXXX....XXXX....XXXX.... ....XXXX....XXXX....XXXX....XXXX XXXX....XXXX....XXXX....XXXX.... ....XXXX....XXXX....XXXX....XXXX XXXX....XXXX....XXXX....XXXX.... ....XXXX....XXXX....XXXX....XXXX XXXX....XXXX....XXXX....XXXX.... ....XXXX....XXXX....XXXX....XXXX end loop COLUPF = t + $08 drawscreen a = a + 1 if a = 60 then a = 0 : t = t + $10 goto loop Edited June 18, 2013 by Cybearg Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted June 18, 2013 Author Share Posted June 18, 2013 Hm, this is gonna take me some time to get down =) Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted June 19, 2013 Author Share Posted June 19, 2013 Hm, could this be achieved by something like this? k = (rand&2) : if !k then k = 1 : goto __Skip_Rand_Room __Skip_Rand_Room if k = 1 then COLUPF = $20 if k = 1 then COLUPF = $30 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.