Jump to content

Photo

DPC+ and Life Counter/Status Bar


11 replies to this topic

#1 KevKelley OFFLINE  

KevKelley

    Chopper Commander

  • 149 posts
  • Lots of hobbies, little time, loads of fun.
  • Location:Orlando

Posted Sun Feb 10, 2019 9:08 AM

Are life counter and/or status bar minikernel not compatible with DPC+?

#2 Muddyfunster OFFLINE  

Muddyfunster

    Moonsweeper

  • 282 posts

Posted Sun Feb 10, 2019 9:41 AM

I don't think so, but I'll defer to the more knowledgable minikernal folks.



#3 KevKelley OFFLINE  

KevKelley

    Chopper Commander

  • Topic Starter
  • 149 posts
  • Lots of hobbies, little time, loads of fun.
  • Location:Orlando

Posted Sun Feb 10, 2019 10:11 AM

I wasn't 100% certain. When I placed it in my code I got a rolling screen and some buzzing so I was gonna opt for a separate screen that announces lives but I liked the idea of a status bar for doing something like act as a timer.

#4 Karl G ONLINE  

Karl G

    Dragonstomper

  • 732 posts

Posted Sun Feb 10, 2019 10:14 AM

No minikernels work with the DPC+ kernel out of the box for various reasons that I mention in the text minikernel topic.  Once I have it working for the text minikernel, I can probably make a version of the lives/status minikernel that will work with DPC+.



#5 KevKelley OFFLINE  

KevKelley

    Chopper Commander

  • Topic Starter
  • 149 posts
  • Lots of hobbies, little time, loads of fun.
  • Location:Orlando

Posted Sun Feb 10, 2019 10:23 AM

Okay. Thanks. I was playing around with a separate screen and I like the idea of a graphic appearing with a life total. I was having a hard time trying to use the title screen wizard so I guess this will be an opportunity for me to learn! I'll keep my eyes on any development...

#6 Tony The 2600 OFFLINE  

Tony The 2600

    Moonsweeper

  • 424 posts
  • 1.19 MHz
  • Location:Adelaide, Australia

Posted Sun Feb 10, 2019 6:58 PM

Im sure i got it working for DPC+ ill see if i have the test program



#7 Tony The 2600 OFFLINE  

Tony The 2600

    Moonsweeper

  • 424 posts
  • 1.19 MHz
  • Location:Adelaide, Australia

Posted Sun Feb 10, 2019 7:16 PM

Yeah it was the playfield lives and status bar i used, not to sure about the minikernal. It's not all that pretty but works nonetheless. Anyway the joystick directions change the values.

Attached File  Life CounterStatus BarTestProgram.bas   4.41KB   8 downloads



#8 KevKelley OFFLINE  

KevKelley

    Chopper Commander

  • Topic Starter
  • 149 posts
  • Lots of hobbies, little time, loads of fun.
  • Location:Orlando

Posted Sun Feb 10, 2019 10:16 PM

Cool. I'm gonna have to check that out. Thanks.

#9 KevKelley OFFLINE  

KevKelley

    Chopper Commander

  • Topic Starter
  • 149 posts
  • Lots of hobbies, little time, loads of fun.
  • Location:Orlando

Posted Thu Feb 14, 2019 2:53 PM

I had finally got an opportunity to implement the test code you had posted and it works perfectly! 

 

Thank you very much.

 

This little thing had kind of held up some gameplay elements I had wanted to play around with.



#10 KevKelley OFFLINE  

KevKelley

    Chopper Commander

  • Topic Starter
  • 149 posts
  • Lots of hobbies, little time, loads of fun.
  • Location:Orlando

Posted Thu Feb 14, 2019 3:21 PM

Now all I have to figure out is how to make the statusbar act as a timer and decrease at a reasonable speed.



#11 Tony The 2600 OFFLINE  

Tony The 2600

    Moonsweeper

  • 424 posts
  • 1.19 MHz
  • Location:Adelaide, Australia

Posted Thu Feb 14, 2019 7:19 PM

No worries, yeah all depends how you're wanting to implement a counter and what for. There is many ways and im sure everyone has their own methods. Personally for a simple global counter i would throw something like this in the mainloop. You can use the same global counter for other features in your game aswell.

 rem x = milliseconds
 x = x + 1
 
 rem y = seconds
 if x = 60 then x = 0 : y = y + 1

 if y = 10 then pfscore2 = %01111111
 if y = 20 then pfscore2 = %00111111
 if y = 30 then pfscore2 = %00011111
 if y = 40 then pfscore2 = %00001111
 if y = 50 then pfscore2 = %00001111
 if y = 60 then pfscore2 = %00000011
 if y = 70 then pfscore2 = %00000001
 if y = 80 then pfscore2 = %00000000 : goto GAMEOVER or whatever

or

 if x = 0 && y = 10 then pfscore2 = pfscore2/2
 if x = 0 && y = 20 then pfscore2 = pfscore2/2
 if x = 0 && y = 30 then pfscore2 = pfscore2/2
 if x = 0 && y = 40 then pfscore2 = pfscore2/2
 if x = 0 && y = 50 then pfscore2 = pfscore2/2
 if x = 0 && y = 60 then pfscore2 = pfscore2/2
 if x = 0 && y = 70 then pfscore2 = pfscore2/2
 if x = 0 && y = 80 then pfscore2 = pfscore2/2 : goto GAMEOVER

So basically the statusbar decrements approximately every 10 seconds. Obviously you can define the x & y variables to whatever you like aswell.

 

You could also use a "for" loop, but for simplicity and understanding purposes i wrote this.



#12 KevKelley OFFLINE  

KevKelley

    Chopper Commander

  • Topic Starter
  • 149 posts
  • Lots of hobbies, little time, loads of fun.
  • Location:Orlando

Posted Thu Feb 14, 2019 8:44 PM

Thanks again! I had wound up using a scheme similar to the first option and had indeed considered using a global counter.

So far I have it set to decrease one position every couple of seconds but can increase from a collision between the player and its target. I will eventually try to make a power up that can increase or stop the clock.

I guess what tripped me up was that I thought the mini kernel was the only way. I had tried to make some kind of pfpixel counter to some success but didn't like the appearance. With this I like that it fills the blank space on either end of the score.




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users