Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

Ads

#1 2018-01-04 00:56:51

npzman
Banned
From: Australia
Registered: 2014-11-19
Posts: 197

Please help me get pause to work on ZGB

Hello everyone

I already asked people on ZGB thread if there is a way to pause the game on the ZGB engine. While Chris was the only one who answered. Sadly that isn't going to work on ZGB. I will be grateful if someone out there helps me out kindly. Then we also add a lives system with a HUD. I would just like to at least have pause menu done the most.

Thanks


Avatar is me
Twitter : @Sfeedman please follow
Join : sfeed.club my website please join

Offline

 

#2 2018-01-04 17:38:40

gbjosh
Member
From: KY
Registered: 2016-06-15
Posts: 30

Re: Please help me get pause to work on ZGB

Have you attempted to write either system? If so post your code and any errors you've gotten.

Offline

 

#3 2018-01-04 18:09:38

npzman
Banned
From: Australia
Registered: 2014-11-19
Posts: 197

Re: Please help me get pause to work on ZGB

gbjosh wrote:

Have you attempted to write either system? If so post your code and any errors you've gotten.

Nope sorry but I am gonna have to try it myself if no one can help


Avatar is me
Twitter : @Sfeedman please follow
Join : sfeed.club my website please join

Offline

 

#4 2018-01-05 12:36:47

npzman
Banned
From: Australia
Registered: 2014-11-19
Posts: 197

Re: Please help me get pause to work on ZGB

bump

any ideas to get the answer I need ?

Last edited by npzman (2018-01-05 12:42:29)


Avatar is me
Twitter : @Sfeedman please follow
Join : sfeed.club my website please join

Offline

 

#5 2018-01-05 15:05:19

helper
New member
Registered: 2018-01-05
Posts: 8

Re: Please help me get pause to work on ZGB

in "main.c":

Code:

... //some code

 void pause() { //here is a function
    sleep(1); // wait 1 second to be sure that the user has released the button
    gotoxy(7,16); //replace the cursor
    printf("PAUSE");

    UPDATE_KEYS(); //we check the keys
    while (!(KEY_PRESSED(J_START)) { //while start is not pressed
       UPDATE_KEYS();
    }

    printf("      "); //if we are here, start is pressed so we can clear the message
 }

 void main() {

  ... //some code

    while(1) {

        while (state_running) {

                        ... //some code

            UPDATE_KEYS();

            if (KEY_PRESSED(J_START) {
              pause();
            }

            SpriteManagerUpdate();

                        ... //some code
        }
    }
  ...//some code
 }
... //some code

I'm not sure if sleep works in gb environment (it's been less than an hour since I discovered the site and the ZGB project)...
I've seen your videos and there are nice, but you should learn the C by following a tutorial before try to make a complete game wink

EDIT: I want my money.

Last edited by helper (2018-01-05 15:10:19)

Offline

 

#6 2018-01-05 15:08:01

npzman
Banned
From: Australia
Registered: 2014-11-19
Posts: 197

Re: Please help me get pause to work on ZGB

helper wrote:

in "main.c":

Code:

... //some code

 void pause() { //here is a function
    sleep(1); // wait 1 second to be sure that the user has released the button
    gotoxy(7,16); //replace the cursor
    printf("PAUSE");

    UPDATE_KEYS(); //we check the keys
    while (!(KEY_PRESSED(J_START)) { //while start is not pressed
       UPDATE_KEYS();
    }

    printf("      "); //if we are here, start is pressed so we can clear the message
 }

 void main() {

  ... //some code

    while(1) {

        while (state_running) {

                        ... //some code

            UPDATE_KEYS();

                        if (KEY_PRESSED(J_START) {
                            pause();
                        }

            SpriteManagerUpdate();

                        ... //some code
                 }
         }
  ...//some code
 }
... //some code

i'm not sure if sleep works in gb environment (it's been less than an hour since I discovered the site and the ZGB project)...
I've seen your videos and there are nice, but you should learn the C by following a tutorial before try to make a complete game wink

Thanks it seen you are new here welcome. Also gbjosh was helping me for a bit on email . Try to use ZGB wish you success

Last edited by npzman (2018-01-05 15:08:18)


Avatar is me
Twitter : @Sfeedman please follow
Join : sfeed.club my website please join

Offline

 

#7 2018-01-05 15:18:45

helper
New member
Registered: 2018-01-05
Posts: 8

Re: Please help me get pause to work on ZGB

Actually I think I'm not going to make some game before long time, I'm just passing through here.
I don't really care about your private life (and about your email): I just want my money smile

Offline

 

#8 2018-01-05 15:27:57

npzman
Banned
From: Australia
Registered: 2014-11-19
Posts: 197

Re: Please help me get pause to work on ZGB

helper wrote:

Actually I think I'm not going to make some game before long time, I'm just passing through here.
I don't really care about your private life (and about your email): I just want my money smile

is this a troll account. Plus still not working on ZGB

Last edited by npzman (2018-01-05 15:28:40)


Avatar is me
Twitter : @Sfeedman please follow
Join : sfeed.club my website please join

Offline

 

#9 2018-01-05 15:29:54

helper
New member
Registered: 2018-01-05
Posts: 8

Re: Please help me get pause to work on ZGB

npzman wrote:

Seriously $10 goes to the person who helps me out. I would even pay before I make you do anything

npzman wrote:

$15 now

I think not...

Offline

 

#10 2018-01-05 15:31:08

helper
New member
Registered: 2018-01-05
Posts: 8

Re: Please help me get pause to work on ZGB

What is the error ?

Offline

 

#11 2018-01-05 15:32:36

npzman
Banned
From: Australia
Registered: 2014-11-19
Posts: 197

Re: Please help me get pause to work on ZGB

I just need to get a pause on ZGB for once this account was made today


Avatar is me
Twitter : @Sfeedman please follow
Join : sfeed.club my website please join

Offline

 

#12 2018-01-05 15:34:53

helper
New member
Registered: 2018-01-05
Posts: 8

Re: Please help me get pause to work on ZGB

I know, I just discovered the website today ><
But does my code work?

Last edited by helper (2018-01-05 15:35:24)

Offline

 

#13 2018-01-05 15:52:40

helper
New member
Registered: 2018-01-05
Posts: 8

Re: Please help me get pause to work on ZGB

Ok adieu.

Offline

 

#14 2018-01-06 00:39:57

npzman
Banned
From: Australia
Registered: 2014-11-19
Posts: 197

Re: Please help me get pause to work on ZGB

it needs to work on ZGB learn it


Avatar is me
Twitter : @Sfeedman please follow
Join : sfeed.club my website please join

Offline

 

#15 2018-01-06 04:23:45

Robbi_Blechdose
Member
Registered: 2017-12-10
Posts: 18

Re: Please help me get pause to work on ZGB

Literally all you need to do (and if you had studied C and a few basic concepts before, you'd know that) is use some variable to store whether the game is running. Only update if that is the case. Because if you don't update, nothing will change on screen, AKA you've got pause.

Offline

 

#16 2018-01-06 06:06:27

npzman
Banned
From: Australia
Registered: 2014-11-19
Posts: 197

Re: Please help me get pause to work on ZGB

Robbi_Blechdose wrote:

Literally all you need to do (and if you had studied C and a few basic concepts before, you'd know that) is use some variable to store whether the game is running. Only update if that is the case. Because if you don't update, nothing will change on screen, AKA you've got pause.

Alright now translate that into C code ZGB can read. If it is that simple why no one is helping. Ignoring that then.

I am sick of making post of the same thing again and again. I want to move on to new stuff

Last edited by npzman (2018-01-06 06:08:28)


Avatar is me
Twitter : @Sfeedman please follow
Join : sfeed.club my website please join

Offline

 

#17 2018-01-06 06:20:25

Robbi_Blechdose
Member
Registered: 2017-12-10
Posts: 18

Re: Please help me get pause to work on ZGB

npzman wrote:

Alright now translate that into C code ZGB can read.

No.

npzman wrote:

If it is that simple why no one is helping.

Because you should be able to do it yourself with a TINY bit of thinking.
We're not here to write your game for you.

Offline

 

#18 2018-01-06 06:33:07

npzman
Banned
From: Australia
Registered: 2014-11-19
Posts: 197

Re: Please help me get pause to work on ZGB

Well I am doing that myself. I spent 5 hour straight. So much rage quits. Please do it just once. I am spreading knowledge in youtube videos so it doesn't benefits just one person.

Last edited by npzman (2018-01-06 06:34:26)


Avatar is me
Twitter : @Sfeedman please follow
Join : sfeed.club my website please join

Offline

 

#19 2018-01-07 01:12:51

npzman
Banned
From: Australia
Registered: 2014-11-19
Posts: 197

Re: Please help me get pause to work on ZGB

this  is taken me even longer robbi if you know how be kind and tell me I will owe you


Avatar is me
Twitter : @Sfeedman please follow
Join : sfeed.club my website please join

Offline

 

#20 2018-01-07 05:00:10

npzman
Banned
From: Australia
Registered: 2014-11-19
Posts: 197

Re: Please help me get pause to work on ZGB

Robbi_Blechdose wrote:

npzman wrote:

Alright now translate that into C code ZGB can read.

No.

npzman wrote:

If it is that simple why no one is helping.

Because you should be able to do it yourself with a TINY bit of thinking.
We're not here to write your game for you.

Please man I tried hard I really want to make game boy ggames and stuff man. Just tell me the code just once

Last edited by npzman (2018-01-07 05:01:29)


Avatar is me
Twitter : @Sfeedman please follow
Join : sfeed.club my website please join

Offline

 

#21 2018-01-07 16:51:56

gbjosh
Member
From: KY
Registered: 2016-06-15
Posts: 30

Re: Please help me get pause to work on ZGB

You may get more/better responses from posting the code from your attempts rather than asking for people to write the code for you.

Offline

 

#22 2018-01-08 02:40:28

npzman
Banned
From: Australia
Registered: 2014-11-19
Posts: 197

Re: Please help me get pause to work on ZGB

here is my code attempt on spriteplayer.c


Code:

    if(KEY_PRESSED(J_START)) {
    void pause() { //here is a function
    sleep(1); // wait 1 second to be sure that the user has released the button
    gotoxy(7,16); //replace the cursor
    printf("PAUSE");
    
    }

the code is easy for you to make why don't you make it. This isn't the place to get your code written ?

Last edited by npzman (2018-01-08 02:41:37)


Avatar is me
Twitter : @Sfeedman please follow
Join : sfeed.club my website please join

Offline

 

#23 2018-01-08 09:50:15

Robbi_Blechdose
Member
Registered: 2017-12-10
Posts: 18

Re: Please help me get pause to work on ZGB

npzman wrote:

This isn't the place to get your code written ?

No. It is the place to get help with your code and maybe small snippets so that you will be able to write it yourself (because then you'll have understood it.)

Now, that is not your whole file, is it?
On another note, you should REALLY look up and work through some C tutorials. Because then you'd immediately realize that that won't compile.
(Because you can only do stuff in functions. But the input check is outside the function!)

Offline

 

#24 2018-01-08 09:53:21

npzman
Banned
From: Australia
Registered: 2014-11-19
Posts: 197

Re: Please help me get pause to work on ZGB

just tell me take $10


Avatar is me
Twitter : @Sfeedman please follow
Join : sfeed.club my website please join

Offline

 

#25 2018-01-08 11:24:52

helper
New member
Registered: 2018-01-05
Posts: 8

Re: Please help me get pause to work on ZGB

OK, just a thing, I made a code for you and you have not tested my code. There is two options: you're a dumbass or you have less than 10 years old. Just copy what I did to you in the f*cking code of your game and delete your other shit. The places where I wrote "..." are used to know where to put these lines of code ... So I specified the file where to put this, so now try my code and especially stop shitting on people with your flood. Danke wink

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson