GBA Pong Game

Job ID: 38794623

Budget: $10 – $30 USD

create a simplified Pong game that compiles and runs on GBA emulators. Here are the design specifications:
● The Pong game consists of one bal, one paddle, and one scoreboard
● Size of the ball: fitting 8x8 sprite
● Size of the paddle: fitting 16x8 sprite
● The paddle will be located at the bottom of the screen. The paddle can be moved around the screen with <- and -> buttons.
● The ball can bounce around the screen’s left, right, and top edges. However, the game will end if it touches the bottom edge of the screen.
● The scoreboard will start from 0, and add 1 every time the paddle hits the ball.

The game will not include any sound effects. The game should feature a modern minimalist visual style. The game should use a black and white color scheme. The game screen will have a black background. The paddle should have moderate movement speed in response to player inputs. To develop the game, it needs to be modified version of following code:

// Butano libraries
#include "bn_core.h" // Core libraries.
#include "bn_log.h"
#include "bn_sram.h"
#include "bn_music.h"
#include "bn_music_actions.h"
#include "bn_music_items.h"
#include "bn_sound_items.h"
#include "bn_sram.h"
#include "bn_math.h"
#include "bn_string.h"
#include "bn_keypad.h"
#include "bn_display.h"
#include "bn_random.h"
#include "bn_regular_bg_ptr.h"
#include "bn_sprite_text_generator.h"
#include "bn_sprite_animate_actions.h"
#include "bn_sprite_palette_ptr.h"
#include "common_info.h"
#include "common_variable_8x8_sprite_font.h"

#include "bn_sprite_items_paddle.h"
#include "bn_sprite_items_ball.h"
#include "bn_regular_bg_items_bg.h"

int main()
{
  bn::core::init();
  bn::music_items::amayadori.play(1);
  bn::regular_bg_ptr bg = bn::regular_bg_items::bg.create_bg(0, 0);
  bn::sprite_ptr left_paddle = bn::sprite_items::paddle.create_sprite(-140, 0);
  bn::sprite_ptr right_paddle = bn::sprite_items::paddle.create_sprite(140, 0);
  right_paddle.set_horizontal_flip(true);
  bn::sprite_ptr ball = bn::sprite_items::ball.create_sprite(0, 0);
  int score = 0;  
  bool enemy_going_up = false;
  int delta_x = 0;
  int delta_y = 0;
  bn::random random;
  bn::sprite_text_generator text_generator(common::variable_8x8_sprite_font);
  bn::vector<bn::sprite_ptr, 16> text_sprites;
  text_generator.generate(-6 * 16, -68, "(Press A to start)", text_sprites);
  while (true)
  {
    if (bn::keypad::up_held() && left_paddle.y() > -48)
    {
      left_paddle.set_y(left_paddle.y() - 1);
    }
    else if (bn::keypad::down_held() && left_paddle.y() < 48)
    {
      left_paddle.set_y(left_paddle.y() + 1);
    }
    if (enemy_going_up)
    {
      if (right_paddle.y() > -48)
      {
        right_paddle.set_y(right_paddle.y() - 1);
      }
      else
      {
        enemy_going_up = false;
      }
    }
    else
    {
      if (right_paddle.y() < 48)
      {
        right_paddle.set_y(right_paddle.y() + 1);
      }

      else
      {
        enemy_going_up = true;
      }
    }
    if (bn::keypad::a_pressed() && delta_x == 0 && delta_y == 0)
    {

      // The 'generate' function fills up the selected vector,
      // so make sure to clear whatever is in it!
      text_sprites.clear();

      // We're setting up a string to represent the new value.
      bn::string<32> txt_score = "Score: " + bn::to_string<32>(score);
      text_generator.generate(-6 * 16, -68, txt_score, text_sprites);
      /*

      x = 0    mod 3    output: 0
      x = 1    mod 3    output: 1
      x = 2    mod 3    output: 2
      x = 3    mod 3    output: 0
      x = 4    mod 3    output: 1
      x = 5    mod 3    output: 2

      */
      /*
      og number = 0    -2   = -2
      og number = 1    -2   = -1
      og number = 2    -2   = 0
      og number = 4    -2   = 1
      og number = 5    -2   = 2

      */
      while (delta_x == 0 || delta_y == 0)
      {
        delta_x = (random.get_int() % 5) - 2;
        delta_y = (random.get_int() % 5) - 2;
      }
      bn::sound_items::pong.play();
    }
    ball.set_x(ball.x() + delta_x);
    ball.set_y(ball.y() + delta_y);
    if (ball.x() < -100)
    {
      if (bn::abs(ball.y() - left_paddle.y()) < 32)
      {
        delta_x = delta_x * -1;
        bn::sound_items::pong.play();
      }

      else
      {
        score--;
        ball.set_position(0, 0);
        delta_x = 0;
        delta_y = 0;
        text_sprites.clear();
        bn::string<32> txt_score = "Score: " + bn::to_string<32>(score) + " (Press A)";
        text_generator.generate(-6 * 16, -68, txt_score, text_sprites);
      }
    }
    else if (ball.x() > 100)
    {
      if (bn::abs(ball.y() - right_paddle.y()) < 32)
      {
        delta_x = delta_x * -1;
        bn::sound_items::pong.play();
      }
      else
      {
        score++;
        ball.set_position(0, 0);
        delta_x = 0;
        delta_y = 0;
        text_sprites.clear();
        bn::string<32> txt_score = "Score: " + bn::to_string<32>(score) + " (Press A)";
        text_generator.generate(-6 * 16, -68, txt_score, text_sprites);
      }
    }
    if (ball.y() < -64)
    {
      delta_y = delta_y * -1;
      bn::sound_items::ping.play();
    }
    else if (ball.y() > 64)
    {
      delta_y = delta_y * -1;
      bn::sound_items::ping.play();
    }

    if (bn::keypad::b_pressed())
    {
      BN_LOG(score);
    }
    bn::core::update();
  }
}
please adjust ball.bmp, ball.json, paddle.bmp, paddle.jason

No additional gameplay features or power-ups will be included. The game will feature solid color backgrounds for a clean and simple look.

The paddle and ball will use basic, solid color textures for a minimalist effect. The paddle and ball will have no animations to maintain a minimalist style. The game will have no transition effects to keep the minimalist style. The game will start directly with gameplay, with no title screen.
Related categories: Game Design Game Development