Hard Pong
- omundodogabriel
- Posts: 33
- Joined: Mon Mar 18, 2013 9:07 pm
- Location: Brazil
- Contact:
Hard Pong
Well, I'm new here on the forum, I became interested in Uzebox when I saw on the Internet, I have a Uzebox I asked my father to help make, he is good at soldering and already has several projects. The Uzebox is already up and running Now it's time to do some more games for him.
Well, the other day I was playing Pong, but since I only have one control for now, could not play 2. So I decided to add an AI. After a few hours trying to figure out how to use the AVR Studio, finally got it. I also colored graphics and added a simple menu ...
So there is my first mod for uzebox. Still missing something here and there, I'll fix later.
Sorry for my bad English... English is not my first language.
Controls:
Up/Down: Move the paddle
Start: Start the game and release the ball
Select: Go back to menu
B: Speed up the paddle
NEW VERSION 1.1
Changelog
- Better menu (with title!)
- Rewrote AI code (now with random values)
- Ball start at random Y position, and go to random sides (like on real game)
- Updated the kernel to the lastest version
- Added transparency to ball
- Some sprite changes
- Ball is now more fast, and game feels more fluid, thanks to the new kernel...
- Attachments
-
- hardpong.uze
- (25.09 KiB) Downloaded 457 times
-
- hardpong.hex
- (69.17 KiB) Downloaded 433 times
Last edited by omundodogabriel on Tue Mar 19, 2013 11:49 pm, edited 1 time in total.
Re: Hard Pong
Hi omundodogabriel, welcome to the Uzebox community!
Finally being able to play pong alone, that's a nice surprise! Pretty good start for a first effort. A feature to add would probably be a difficulty setting, cause I play 15mins and still 0-0!
Finally being able to play pong alone, that's a nice surprise! Pretty good start for a first effort. A feature to add would probably be a difficulty setting, cause I play 15mins and still 0-0!
- omundodogabriel
- Posts: 33
- Joined: Mon Mar 18, 2013 9:07 pm
- Location: Brazil
- Contact:
Re: Hard Pong
I need some help on this... I rewrote the code. Here the new AI code:uze6666 wrote:Hi omundodogabriel, welcome to the Uzebox community!
Finally being able to play pong alone, that's a nice surprise! Pretty good start for a first effort. A feature to add would probably be a difficulty setting, cause I play 15mins and still 0-0!
Code: Select all
//AI
if (X < 0) {
if (Paddle[1].y != 96) {
if(Paddle[1].y < 96 && Paddle[1].y < 184) {
Paddle[1].y += 2;
}else if(Paddle[1].y > 8) {
Paddle[1].y -= 2;
}
}
r = rand() % 25;
} else {
if (Paddle[1].y + r != pBall->x) {
if(pBall->y < Paddle[1].y + r && Paddle[1].y > 8) {
Paddle[1].y -= 2;
} else if(pBall->y > Paddle[1].y + r && Paddle[1].y < 184) {
Paddle[1].y += 2;
}
}
}
For now i will start working on my new project, a port of balloon fight for the Uzebox
Re: Hard Pong
welcome to the community!!
Wow, nice work!
Yeah, I made an AI with Pong on my One Chipbasic Computer and I did it the same way.
But you have to do it like Uze said. You need at least 3 difficult levels.
Because when you let the AI calculate the best position, a game would take more than 15 minutes without any point to score!
So, when you set another variable to set the reaction rate of the AI which would be randomize, then the AI would slow down the movements without that it looks artificial!
Wow, nice work!
Yeah, I made an AI with Pong on my One Chipbasic Computer and I did it the same way.
But you have to do it like Uze said. You need at least 3 difficult levels.
Because when you let the AI calculate the best position, a game would take more than 15 minutes without any point to score!
So, when you set another variable to set the reaction rate of the AI which would be randomize, then the AI would slow down the movements without that it looks artificial!
The last digit of Pi is 7! I calculated this, as I counted to infinity yesterday!
- omundodogabriel
- Posts: 33
- Joined: Mon Mar 18, 2013 9:07 pm
- Location: Brazil
- Contact:
Re: Hard Pong
I ended up doing something stupid, I left the code in the downloads folder, and today i accidentally deleted ... Well, I'm too lazy to retrieve the code, so this is the final version. My next project will be a port of Balloon fight.
Re: Hard Pong
Hi! If you are about this game for the NES, I'll be glad to see her on Uzebox. http://en.wikipedia.org/wiki/Balloon_Fight
http://www.youtube.com/watch?v=DSKXykKsIiA
http://www.youtube.com/watch?v=DSKXykKsIiA
Re: Hard Pong
Ah, that's bad news, unfortunately that's something that happens far too often. Put your next project in source control right away! Btw, balloon fight looks like a nice project, check out if you will have enough sprites thought.omundodogabriel wrote:I ended up doing something stupid, I left the code in the downloads folder, and today i accidentally deleted ... Well, I'm too lazy to retrieve the code, so this is the final version. My next project will be a port of Balloon fight.
- DaveyPocket
- Posts: 378
- Joined: Sun Sep 14, 2008 8:33 pm
- Contact:
Re: Hard Pong
Balloon fight has to be one of my top favorites!
Maybe this could incorporate online play if Uze finishes his network adapter
Would be awesome to do head-to-head over the internet, kind of like arcade version where the other side of the machine is second player:
Maybe this could incorporate online play if Uze finishes his network adapter
Would be awesome to do head-to-head over the internet, kind of like arcade version where the other side of the machine is second player:
Re: Hard Pong
The challenge with this game is really the video mode. It really needs to video pages to avoid flicker. A simple 1bpp mode looked too cheap, so I needed a custom mode which also renders the grid and the flashing cursor in real time. I'm wte surprised with speed, thought it would be much slower...
Kaiyara