My game

Post here for things completely unrelated to Helmet Heroes.

My game

Postby Naughty » Sat Feb 07, 2015 2:54 pm

I seen another thread like this, go i guess ill post mine AND DONT EXPECT IT TO BE AWESOME, its my first game test of pong

Im learning C# and JS to make games within unity3d and im starting to learn some flash development aswell.

My main knowledge currently resides within website development so its not too different when it comes to learning


My first game: Pong. Lol.

left player: UP: A / DOWN: S

right player: UP: up key / DOWN: down key

I made it two player because i dont know how to make an system to play back, but i also tried to do this as fast as i could


http://www.kongregate.com/games/Derpzen/2-player-pong
Last edited by Naughty on Sat Feb 07, 2015 3:52 pm, edited 1 time in total.
User avatar
Naughty
 
Posts: 776
Joined: Tue Dec 16, 2014 3:13 pm

Re: My game

Postby Lycanblade » Sat Feb 07, 2015 3:14 pm

terribly boring, with no objective, but i guess i shouldnt expect much from a test

i like the color scheme and the fact that it's on kong tho XD
and it's very smooth and simple(took me 10 min to fugure out how to play :lol: )
ImageImage
Lycanblade
 
Posts: 5541
Joined: Thu Jun 26, 2014 9:42 am
Location: That corner where I always go to cry...the one with hot blondes

Re: My game

Postby Stabber » Sat Feb 07, 2015 3:44 pm


Forgive me if this won't work for your game (I don't have the unity plugin installed on my computer)

Here is how you could make an AI:

difficulty: easy = 0, normal = 1, hard = 2, impossible = 999

computerY: y position of the center of the paddle (may be different for your program)
ballY: y position of the center of the ball
ball_radius: radius of the ball

Code: Select all
Each game tick:
// move paddle towards the ball vertically.  Higher difficulties move faster
if (computerY > ballY) {
    computerY = max(computerY - ballY, computerY - 2 * difficulty - 3);
} else if (computerY < ballY) {
    computerY = min(ballY - computerY, computerY + 2 * difficulty + 3);
}



If the angle the ball ricochets of the paddle changes based on paddle position (again, I haven't installed the plugin to play your game, so sorry if none of this applies), you can do more complicated stuff:

if ball is heading towards the computer player (check X velocity to see if this is true):

have computer calculate where the y-position of the ball will be when the ball is close enough to be hit by the computer's paddle.

Calculate the desired Y position of the ball that the player has to hit (which location on the player's side will be hardest for the player to defend? This could depend on the current position of the player's paddle, and the maximum speed at which the player's paddle can move up/down).
Calculate the necessary x/y velocity of the ball to go from predicted y-position at the computer's side to the desired y-position at the player's side.

From this x/y velocity, figure out the angle (use arctan) that the ball will have to bounce off at when the computer's paddle hits it.

Use this angle to find the necessary y-position of the paddle.
Use the movement code above (replace ballY with necessary Y position) to have the paddle move there.

User avatar
Stabber
 
Posts: 973
Joined: Fri Aug 02, 2013 2:11 pm

Re: My game

Postby itblobboy » Sat Feb 07, 2015 8:52 pm

Talk about classy, this guy over here remade pong for education!
MisoSoup247 wrote:Thanks guys next story is Sintoques Legacy which will be out in 2017 stay tune.

http://giveadamn.co.uk/give/itblobboy
User avatar
itblobboy
 
Posts: 9220
Joined: Fri Aug 02, 2013 10:55 pm
Location: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Re: My game

Postby koalasium » Sat Feb 07, 2015 9:14 pm

Apparently I need unity web player, which I don't and won't have. Is there some other way to play it?
Spoiler: show
Image

Image
Credits to Naughty for the sig
Seriously though... We need to do the universe a favor and wipe this world out. Admittedly, we're bound to do it whether we intend to or not in just a matter of time.
-Tomatha

Check out my new blog.
User avatar
koalasium
 
Posts: 3592
Joined: Mon Jul 21, 2014 9:27 pm
Location: Koalasium's Dictatorship

Re: My game

Postby Lu-Bu » Sat Feb 07, 2015 10:30 pm

koalasium wrote:Apparently I need unity web player, which I don't and won't have. Is there some other way to play it?

wait you need unity? probably means its a 3D game and i cannot play those games due to me not having a
"3D graphic card" or some shiz.
Image
Image
My Channel: https://www.youtube.com/channel/UCwGN06 ... yCg/videos
Hail the king of ( ͡° ͜ʖ ͡°)'s
User avatar
Lu-Bu
 
Posts: 5663
Joined: Thu Apr 24, 2014 5:56 pm
Location: Just chilling back at my roots

Re: My game

Postby StormNinja » Tue Feb 10, 2015 7:27 am

Stabber is here to show off his badass skills once again.
Image

Pusheen.com

S.W.A.G = SOMETHING. WE . ASIANS. GOT
User avatar
StormNinja
 
Posts: 1742
Joined: Thu Mar 13, 2014 5:15 pm
Location: Banging my gorgeous old leader Naruto.

Re: My game

Postby Naughty » Tue Feb 10, 2015 12:44 pm

StormNinja wrote:Stabber is here to show off his badass skills once again.


Hey i give stabber props he knows what he is talking about, he even helped me with some of the code via my blog making it more efficient. Stabber, ever thought about going into making games yourself?

We could try to come up with some helmet heroes related mini games for people here to play and if you arent that good with photoshop i got that covered
User avatar
Naughty
 
Posts: 776
Joined: Tue Dec 16, 2014 3:13 pm


Return to Off Topic

Who is online

Users browsing this forum: No registered users and 1 guest

cron