games  anime  |  toys
This is a Dtoid readers's blog. For staff blogs click here. Confused? read this Create you own!  |   Members: Login now





Pong-Karuga Dev Blog #1
GoS-CPT-Stewart | 8:23 PM on 12.11.2008 0 comments


So, for the past couple of days I've been slacking on getting Pong-Karuga done. Being sick (sore throat, headache, runny nose, coughing) didn't really help my case either. So now that I'm back on the job I've got a bit more to share.

Unfortunately there are still no sprites or any cool effects put into the game yet, but I'd rather make the game work and have the all of the systems down before I try and get all fancy with the other stuff.

A few days ago one of my Classmates and I worked together on getting a really basic physics engine into the game. It's not using gravity or anything like that, but the velocity of the ball is based around time rather than how fast your processor is. Here's a little explanation to help understand what I'm talking about...

My Pong has 3 main functions (which end up calling a bunch of other smaller functions), GetInput, Simulate, and Render. The GetInput function checks to see if a key is held down. The simulate function handles the moving of the Ball and the calculations for the AI. And the Render function paints the whole thing to the screen. The way movement was originally handled was based on two things, an increment and a sleep.

The Sleep function basically tells the program to stop doing anything for the specified amount of time. The problem with this is that the Sleep function isn't always accurate. Depending on your processor and Sleep of 1 millisecond can take 10 milliseconds to wake back up. This means that the slower your computer it, the slower the ball will move because it won't make it to that Simulate function as often as a faster computer would. This also means that when you resize the window to something bigger (or maximize it), it will take longer to render the components and thus delay the time it takes to get back to that Simulate function and change the ball's position.


Here you can see the y-Velocity of the ball is 825, quite a bit higher than the 500 to start with. Too bad I suck and lost a life in the process of taking this screenshot...

So what we ended up doing is basing our movement off of a time step. Basically we call a function to get a time (the number of milliseconds since your computer started) and when the next call to simulate comes around it grabs the new time and compares it to the old one. That time difference becomes the "time step" which we use to tell us how many pixels to move. So this means that no matter how fast or slow your computer is, the ball will always move at (what I've got it set to) 500 pixels per second. This also means that with a real velocity, you can use the paddles to "spin" the ball by moving as you hit it.

Once that was done and implemented I started to work on the actual Pong-Karuga mechanics. I figured I'd start with something a little easier: the Charge shot system. Currently, whenever your opponent misses the ball and it hits the wall behind him, you gain some charge. Once you've hit the wall 5 times You've gained a "charge shot". Once you've filled your meter, the next time you hit the ball it will stick to your paddle. Pressing Space bar allows you to launch the ball again. This makes the ball grow to 2.5 times its original size and move 3.5 times faster across the board, firing at a random angle from the paddle. If the ball hits your opponent's wall he will lose a life, but if he manages to hit it, you volley the super shot back and forth until it hits someone's wall.


Charged shot ball! Hooray!

Eventually once polarity has been introduced if the opponent hits it with the wrong polarity he's lose a life too. But I haven't implemented that yet. I'm still trying to think of a way to have the AI choose polarity without it being unfair due to his being able to immediately know which polarity it is.

Anyway, I'm off to work on this some more. I'll be back in another couple of days with an update, hopefully one that starts with a "D" and ends with an "ownloadable Alpha".



Attached photos:

Photo Photo

Is this post awesome? Vote it up!

0


Comment with Facebook





Click connect and comment instantly!

Comment with Dtoid





New? SIGN UP - it takes 5 seconds

No comments yet. Steal first post!


Comment with Facebook





Click connect and comment instantly!

Comment with Dtoid





New? SIGN UP - it takes 5 seconds

Comments policy

Destructoid is an open discussion community. You don't need to "audition" to post a comment - just speak your mind. We respect differing opinions on the site, so have at it. Be smart, funny, insightful, clueless, or cute -- but back it up with substance. Keep your cool, keep it fun. We only ask that you act respectfully and above all: don't be a troll and ruin it for everyone else. Don't bring down gamers or we'll, you know, gently shoot you in the face and stuff you into a flaming mailbox. Each comment is your opportuntity to make this community awesomer. Is that even a word?

Avoiding the banhammer only requires common sense: spamming, trolling, racism, NSFW stuff, and other forms of sucking will not be tolerated. If anyone is griefing please report abuse. Be good. Don't suck!

 about me

So yeah, I'm Dan. Uhh... i like stuff.

Consoles I own :
NES
SNES
N64
Gamecube
Wii
DS
PS(1)
PS2
PS3
Dreamcast
Xbox 360
Atari 7200
and a sweet PC.

Currently attending Full Sail for the Game Development (read: programming) Bachelor's Degree.

I've also begun working towards the eventual creation of a development studio, "Odd Man Out Studios", which I hope to start up with a couple of friends. http://www.oddmanoutstudios.net

Umm... that's about it.

 xbox 360 gamertag
 friends' updates
AgentMOO's Profile AgentMOO
The wrong thing: Sh*t just got real
CaffeinePowered's Profile CaffeinePowered
TF Tuesdays - 10/7
Conrad Zimmerman's Profile Conrad Zimmerman
Dale North psyched about Fallout 3 360 Avatar items
Coonskin05's Profile Coonskin05
A Not-So-Weird Kid's Top 10: NES Games
craigbezzle's Profile craigbezzle
Fails at blogging.
EternalDeathSlayer's Profile EternalDeathSlayer
Happy Thanksgiving Destructoid, I'm thankful for you and some other stuff.
GoS-CPT-Stewart's Profile GoS-CPT-Stewart
Up and Atom - A Molecular Puzzle Game
Ha-Puken's Profile Ha-Puken
RESPECT = DESERVED (NSFW)
Hamza CTZ Aziz's Profile Hamza CTZ Aziz
Weekend Destructainment: Jesus cheats at Modern Warfare 2
Jim Sterling's Profile Jim Sterling
Games of the week for 11/29/09: Cheesy dipstick edition
Jordan Devore's Profile Jordan Devore
Exploring the daunting tunnels of 2010 IGF entrant 'Cave'
Knives's Profile Knives
Destructoid's PAX 09 Panel
MaxVest's Profile MaxVest
My New Job As A Chicken Sexer -- Not What I Thought It Would Be
Niero's Profile Niero
Join Destructoid at the University of Miami's Launchpad
nopk's Profile nopk
Sins of a Solar Empire: Review
pixelpunx's Profile pixelpunx
Hey Portland! Chiptune Show tonight!
ROCKETR's Profile ROCKETR
Fails at blogging.
SpilledMilk's Profile SpilledMilk
Animation Blow-out! : Fresh Prince was right
Super Ghosts n  Ghosts's Profile Super Ghosts n Ghosts
Developer Diary #2 - Super Ghosts 'n ... Ghosts?: The Movie Colon The Game!
Tiff's Profile Tiff
Post-PAX Love & Farewell to Destructoid (for now)
Y0j1mb0's Profile Y0j1mb0
PS3 Friday Night Fights: I CAN'T MOVE EDITION


 

 
  get involved

register or login
post a blog
post a forum
enter a contest
contribute a news tip
suggest a feature
be a guest editor
support

new member's guide
login assistance
tech support
report abuse
email our editors
read our dev blog
nuclear crisis?
keep in touch

RSS feed
Twitter
Facebook
Myspace
Flickr
Game nights
Meetup+play online
seriously

about Destructoid
advertising
terms of use
privacy policy
jobs at MM
buy our crap
our network

Tomopop
Japanator
Despingation?




Destructoid is an independently-run publication forged by our love of video games and the gaming community's need of accountable enthusiast press
living the dream since March 16, 2006