WIP - Back to nature

Use this forum to share and discuss Uzebox games and demos.
User avatar
Kilo
Posts: 330
Joined: Wed Dec 19, 2012 3:43 pm
Location: AC, Germany

WIP - Back to nature

Post by Kilo »

After a long absence of game programming, do I start again with some very easy concept!
So I decided to reactivate a game from 1982.
it's called BACK TO NATURE and I know it from the Commodore 64.
Played it very very often when I was a child. :D

You control the frog by the numpad in order to get his Body low, middle or high and his tongue short middle or Long.
So I have to think about the controlling with the SNES Pad.
But this would be no Problem... ;)
It's a simple game but very addictive

Image
The last digit of Pi is 7! I calculated this, as I counted to infinity yesterday!
User avatar
L4rry
Posts: 242
Joined: Sun Dec 28, 2014 7:19 am
Location: Cape Town, South Africa

Re: WIP - Back to nature

Post by L4rry »

Looks interesting. Looking forward to play a demo :)

True story. So when I was initially wanting to get into retro game development back in 2014/13 I bought a second hand Commodore 64 from Gumtree (South Africa's version of Craigslist). My neighbour had one when I was growing up so I was super stoked to own one myself. Then when I powered it on the first time the power supply literally caught fire :lol: I was bumbed back then, but it caused me to look around for 8bit open source gaming consoles. So I wouldn't have found Uzebox if that massive epoxy brick didn't spontaniously combust :mrgreen:
User avatar
Kilo
Posts: 330
Joined: Wed Dec 19, 2012 3:43 pm
Location: AC, Germany

Re: WIP - Back to nature

Post by Kilo »

Ok,
here's a really short demo of how it could be.

The original game uses the numpad in order to set the height of the Body and the length of the tongue.
Here's a screenshot from the original:
Image

My first thought was to set the values with UP, DOWN and LEFT, RIGHT.
Then, when you press 'A' the frog will move his Body and his tongue with your Settings.
There will be some bugs in the game... no, not these bugs you mean. I mean the real bugs which frogs love to eat :lol:
And you have to catch these bugs with your Settings of Body height and tongue length.

Every move will decrease your calories. Every bug will increase your calories. That's the first Thing you have to know...
But here's a Little demo of the possible movement.

Please note: The whole demo with graphics, etc. was done in 1-2 hours today.

try it...
Attachments
Backtonature.uze
(34.47 KiB) Downloaded 325 times
The last digit of Pi is 7! I calculated this, as I counted to infinity yesterday!
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: WIP - Back to nature

Post by Artcfox »

Looks cool, though when I pressed the B button, I was no longer able to change the settings using the arrow keys, and his tongue appeared detached from the body.

How are you doing input handling in the code? It doesn't feel that responsive in that there is a long time between when I press a button and when it registers.
User avatar
Kilo
Posts: 330
Joined: Wed Dec 19, 2012 3:43 pm
Location: AC, Germany

Re: WIP - Back to nature

Post by Kilo »

Thx...
Well I forgot to remove one button handle routine of the B button :D sorry... it was for testing something.

What do you mean? When you press the A button, does the frog not move immediately?

EDIT: I updated the .uze file.
I removed the B Button handle and made the movement a bit faster.
Hope that it is ok now.
The last digit of Pi is 7! I calculated this, as I counted to infinity yesterday!
User avatar
Jubatian
Posts: 1564
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: WIP - Back to nature

Post by Jubatian »

Interesting PETSCII source for sure, although the gameplay feels a bit annoying (I just watched a video of it). Is it a BASIC game?

Looks like Mode 1 to me with 6x8 tiles. Currently sure, there is no mode exactly appropriate for this game, but there could be (technically it is possible). If you would like, I might jump into developing a 40x25 capable attribute mode for these sort of things (nobody exactly ever requested such a mode, but certainly it is something which could be a nice addition to Uzebox's capabilities). It most likely would take 3K RAM (40x25 = 1000 bytes, needs a character select, an FG and a BG color for 3000 bytes total).
User avatar
Kilo
Posts: 330
Joined: Wed Dec 19, 2012 3:43 pm
Location: AC, Germany

Re: WIP - Back to nature

Post by Kilo »

Yep it feels very annoying but hey... it's from 1982 :D
Like I wrote, I choosed a simple gameplay to start again programming. :P

Thank you for help but I think I will finished this small game very fast and without an own viedo mode. It's okay ;)
But you're right, it's mode 1 with 6x8 tilesize. Wow. Eagle eyes!! :D

You never replied to my hungarian allusions :D
The last digit of Pi is 7! I calculated this, as I counted to infinity yesterday!
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: WIP - Back to nature

Post by Artcfox »

Sometimes when I press the buttons nothing happens, and sometimes the words on the right side of the : vanish.

How are you doing the input handling?

Edit: Pressing Down when the BODY is set to LOW doesn't register the keypress until you press it twice. Same with Pressing Left when the TONGUE is set to SHORT. You have to press Left twice for it to register.

With the new version I'm not seeing anything vanish on the right side of the colon anymore.
Last edited by Artcfox on Sun Dec 03, 2017 10:07 pm, edited 1 time in total.
User avatar
Kilo
Posts: 330
Joined: Wed Dec 19, 2012 3:43 pm
Location: AC, Germany

Re: WIP - Back to nature

Post by Kilo »

Well... I use the input handle from the API
Function ReadJoypad.

Code: Select all

c=ReadJoypad(0); 	
if(c&BTN_A){ 
while(ReadJoypad(0)!=0);

// do some action
Mh... for me it works.
What's about the other ones here?

Edit:
Have to check it tomorrow what you said.
Well... it was just a short demo which I not complete checked for bugs or something.
The last digit of Pi is 7! I calculated this, as I counted to infinity yesterday!
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: WIP - Back to nature

Post by Artcfox »

Kilo wrote: Sun Dec 03, 2017 10:07 pm Well... I use the input handle from the API
Function ReadJoypad.

Code: Select all

c=ReadJoypad(0); 	
if(c&BTN_A){ 
while(ReadJoypad(0)!=0);

// do some action
Mh... for me it works.
What's about the other ones here?
I see you're calling ReadJoypad more than once. Have you considered doing it like this?

Code: Select all

typedef struct {
  uint16_t held;
  uint16_t prev;
  uint16_t pressed;
  uint16_t released;
} __attribute__ ((packed)) BUTTON_INFO;

int main() {
  BUTTON_INFO buttons;
  memset(&buttons, 0, sizeof(BUTTON_INFO));

  for (;;) { // main loop
    // Read the current state of the player's controller
    buttons.prev = buttons.held;
    buttons.held = ReadJoypad(0);
    buttons.pressed = buttons.held & (buttons.held ^ buttons.prev);
    buttons.released = buttons.prev & (buttons.held ^ buttons.prev);
  
    if (buttons.pressed & BTN_DOWN) {
      // Perform an action when that BTN_DOWN is initially pressed
    }

    if (buttons.released & BTN_DOWN) {
      // Perform an action when that BTN_DOWN is initially released
    }
  }
By keeping track of the previous state of every button like that, you can perform actions exactly when certain buttons go from the unpressed state to the pressed state, or from the pressed state to the unpressed state.
Post Reply