Jump to content




[Game] SkullPong V1.10(Massively Amazing New Features!)


  • You cannot reply to this topic
29 replies to this topic

#1 Skullblade

  • Members
  • 470 posts
  • LocationThe Big Apple, NY

Posted 20 January 2013 - 07:45 PM

SkullPong V1.10

What is SkullPong?
SkullPong is a fairly basic pong game that I threw to gather in about an hour.
The basic features are...
-It works
-Score Keeper
-You can move your paddle
-Literally unbeatable computer opponent (Someone help me make the computer make mistakes....)
SkullPong Update V1.10
Massively Amazing Huge Update!!!
-Under the hood work(Implemented better moving systems)
-Fancy New Menu
-Amazing Pause Menu/Function(press f1)
-Info/Controls/Help Function
-Quit function
-Survival Mode, Screen flashes and you lose if the AI scores on you
-Local Multiplayer mode
-New Video:D
-And More
Future Features
-MultiPlayer over rednet
-Beatable computer opponent

Download!
pastebin get 8LU0sjFR SkullPong


Controls/Rules
Spoiler
Screenshots
NEW Movie
Spoiler
As always feedback is welcome :)

#2 nitrogenfingers

    Lua Professor

  • Members
  • 551 posts
  • LocationAustralia

Posted 20 January 2013 - 07:53 PM

I downloaded to give it a try, and got

skullpong:123: index expected, got nil.

Regarding AI opponents, the way "beatable" AI is usually done in such games is to have the computer opponent have a fixed or maximum speed (which increases with the difficulty), but have the ball incrementally increase in speed. Eventually it will move faster than the computer opponent can, which will usually cause him to lose.
The strategy and game play for pong is quite different in ComputerCraft than it is in the arcade/home originals, as they were played with analogue paddle controllers rather than digital keyboards, and had a much more fluid range of movement, so it demanded more precision than ComputerCraft versions can.

#3 Skullblade

  • Members
  • 470 posts
  • LocationThe Big Apple, NY

Posted 20 January 2013 - 08:05 PM

Thx for the quick reply nitro, I am always amazed at your level of knowledge of all things computers :P I'll have to work on variable movement speeds in the next update.

Also bug fixed...Dumba** mistake...very tired its 2am here...
I had forgotten to declare a table(yes I did bug test, the versions before this had the table but I changed the way it was implemented so the table was still running on the computer and i got no error)

#4 TheOddByte

    Lazy Coder

  • Members
  • 1,607 posts
  • LocationSweden

Posted 20 January 2013 - 09:32 PM

When you wrote "Unbeatable" you should have wrote "Non Moving"
Other than that It's pretty nice,
Maybe You Should do a menu So The One who Plays the game can select if they wanna
play againts an Al or If they want to play multiplayer.

#5 Skullblade

  • Members
  • 470 posts
  • LocationThe Big Apple, NY

Posted 21 January 2013 - 03:58 AM

Hellkid what do you mean non moving? It seemed to work fine in all my tests(I was tired and had a pounding headache though...)I was only able to score 2 points on the "AI"....time for more testing; can anyone second Hellkid?

Also Hellkid in the next version I will be implementing multiplayer support and there will be a menu(in OP)


EDIT: HellKid I just had a very good, funish game against the computer and it seems to be working perfectly...I scored 0 points the computer scored 7 :( (This was on a new computer in a new world) is it still not moving for you? Do you know that you are the green paddle and the controls are the up and down arrow keys.....?

#6 GravityScore

  • Members
  • 796 posts
  • LocationLand of Meh

Posted 21 January 2013 - 04:27 AM

Hey Skullblade. I like the pong game - nice and simple :D. I have a few suggestions for you,

1. Instead of storing the ball's direction as a string, then having to use 4-way if statements to update the position, why not just give the ball an x and y velocity, and just add that to the position. So for example, if it was moving down and to the right, you would give it an x velocity of 1, and a y velocity of 1, so that when you added it to the ball's position, the xpos and ypos would both be 1 larger. Another example: if the ball was moving to the top right, xvel = 1 and yvel = -1.

2. This could also be used to change the speed, by using 1.5 instead of 1, for example.

3. Also, when you hit a wall, all that would be needed to update is the corresponding value. Eg:
local w, h = term.getSize()
if ypos == h or ypos == 1 then yvel = yvel * -1 end
(if the y position of the ball is on the top row or the bottom row of the screen, change the direction it is going).

You may like your way, or you may decide to change it, I don't mind :P

I also made my own pong a few weeks ago if you need any ideas :P

#7 Skullblade

  • Members
  • 470 posts
  • LocationThe Big Apple, NY

Posted 21 January 2013 - 04:32 AM

actually Gravity I like your way....makes more sense I could really shorten the code using that thanks :)
is the "AI" moving for you, for some reason its not for HellKid....?

Oh and I also made a light shot movie of me playing it(Badly)...I put it in screenshots

#8 GravityScore

  • Members
  • 796 posts
  • LocationLand of Meh

Posted 21 January 2013 - 04:35 AM

I had to actually download it then to find out :P I made that assessment from looking at the code :P

After playing it, the AI works for me, although I think a better AI would simulate the ball's movements, and predict where it would land, then move to that point at a certain pace, instead of just following the ball's ypos.

You could simulate by just copying and pasting your ball moving code, and remove the sleeps, then run it until the xpos == screenwidth.

EDIT: I love the movie idea for screenshots and demonstrations... More people should do this!

#9 Skullblade

  • Members
  • 470 posts
  • LocationThe Big Apple, NY

Posted 21 January 2013 - 04:54 AM

The movie idea was just me being lazy and not wanting to take screenshots, crop them, and upload them....light shot is much faster and shows more:D

I originally had the AI predict the future ball positions but it was very buggy and I settled on what I have now but I will fix AI in my next update :D

#10 TheOddByte

    Lazy Coder

  • Members
  • 1,607 posts
  • LocationSweden

Posted 21 January 2013 - 10:45 AM

View PostSkullblade, on 21 January 2013 - 03:58 AM, said:

Hellkid what do you mean non moving? It seemed to work fine in all my tests(I was tired and had a pounding headache though...)I was only able to score 2 points on the "AI"....time for more testing; can anyone second Hellkid?

Also Hellkid in the next version I will be implementing multiplayer support and there will be a menu(in OP)


EDIT: HellKid I just had a very good, funish game against the computer and it seems to be working perfectly...I scored 0 points the computer scored 7 :( (This was on a new computer in a new world) is it still not moving for you? Do you know that you are the green paddle and the controls are the up and down arrow keys.....?
Yeah I know that but the red one isn't moving,
I should have mentioned that I run it with CCemu..
But the red one just stands still In the Middle :(

EDIT: Just deleted it and re downloaded , Works now :D

#11 TheOddByte

    Lazy Coder

  • Members
  • 1,607 posts
  • LocationSweden

Posted 21 January 2013 - 10:50 AM

So at it seems you have done so the Al follows the ball all the time,
Am I correct?
Since That seemed to be my error since it just bounced it the middle and not up and down,
So the Al just stood still..

#12 Skullblade

  • Members
  • 470 posts
  • LocationThe Big Apple, NY

Posted 21 January 2013 - 10:50 AM

View PostHellkid98, on 21 January 2013 - 10:45 AM, said:


Yeah I know that but the red one isn't moving,
I should have mentioned that I run it with CCemu..
But the red one just stands still In the Middle :(

EDIT: Just deleted it and re downloaded , Works now :D
yay :lol:

View PostHellkid98, on 21 January 2013 - 10:50 AM, said:

So at it seems you have done so the Al follows the ball all the time,
Am I correct?
Since That seemed to be my error since it just bounced it the middle and not up and down,
So the Al just stood still..
yeh, I am working on a more advanced "Ai" for the next update right now

#13 Skullblade

  • Members
  • 470 posts
  • LocationThe Big Apple, NY

Posted 22 January 2013 - 12:14 PM

SkullPong V1.10

Massively Amazing Huge Update!!!
-Under the hood work(Implemented better moving systems)
-Fancy New Menu
-Amazing Pause Menu/Function(press f1)
-Info/Controls/Help Function
-Quit function
-Survival Mode, Screen flashes and you lose if the AI scores on you
-Local Multiplayer mode
-And More

#14 CCPoster

  • Members
  • 13 posts

Posted 22 January 2013 - 12:50 PM

As for making the Computer miss you could just do a:
chance = math.random(1,2) -- Gives the Computer a 50% chance of missing math.random(1,8) will give the computer a 1/8 chance of missing
if chance = 1 then
  misses ball
else
  hits ball
end


#15 Skullblade

  • Members
  • 470 posts
  • LocationThe Big Apple, NY

Posted 22 January 2013 - 12:58 PM

PixelApp I have considered that and I might do it...if I do the odds would be 1/5 or 1/10 for it missing, but right now I'm trying to work on a more sophisticated way rather then it just "missing"(probably just by it stopping right before hitting the ball)

#16 SuicidalSTDz

    Permutator of Strings

  • Members
  • 1,308 posts
  • LocationPennsylvania

Posted 31 January 2013 - 01:54 PM

So we meet again Skullblade ;) After looking at your programs, I ran across SkullPong. I absolutely love it and would be honored if I could add it within EnderOS as one of the games(Plan to add more) Thanks again!

#17 Skullblade

  • Members
  • 470 posts
  • LocationThe Big Apple, NY

Posted 01 February 2013 - 12:59 AM

I would love for you to use skull pong in your OS If u have any question or find any bugs plz tell me. I also might try to get the rednet multiplayer mode working...it's got a pesky bug...

Off topic: have u tried the survival feature? It's loads of fun :D

#18 SuicidalSTDz

    Permutator of Strings

  • Members
  • 1,308 posts
  • LocationPennsylvania

Posted 01 February 2013 - 04:05 PM

View PostSkullblade, on 01 February 2013 - 12:59 AM, said:

I would love for you to use skull pong in your OS If u have any question or find any bugs plz tell me. I also might try to get the rednet multiplayer mode working...it's got a pesky bug...

Off topic: have u tried the survival feature? It's loads of fun :D
I have and... I LOVE it :3 I will also keep an eagle eye out for bugs(Even though it seems fairly flawless :))

#19 Skullblade

  • Members
  • 470 posts
  • LocationThe Big Apple, NY

Posted 01 February 2013 - 04:52 PM

View PostSuicidalSTDz, on 01 February 2013 - 04:05 PM, said:

View PostSkullblade, on 01 February 2013 - 12:59 AM, said:

I would love for you to use skull pong in your OS If u have any question or find any bugs plz tell me. I also might try to get the rednet multiplayer mode working...it's got a pesky bug...

Off topic: have u tried the survival feature? It's loads of fun :D
I have and... I LOVE it :3 I will also keep an eagle eye out for bugs(Even though it seems fairly flawless :))
Thanks I am quite proud of it but if you play survival for too long you might have a stroke(I take no responsibility :D )

While I don't think that I would call it flawless(the AI needs work and I want to update the collision detector) i appreciate the complement and cant wait to c skullpong used

#20 SuicidalSTDz

    Permutator of Strings

  • Members
  • 1,308 posts
  • LocationPennsylvania

Posted 01 February 2013 - 05:50 PM

View PostSkullblade, on 01 February 2013 - 04:52 PM, said:

View PostSuicidalSTDz, on 01 February 2013 - 04:05 PM, said:

View PostSkullblade, on 01 February 2013 - 12:59 AM, said:

I would love for you to use skull pong in your OS If u have any question or find any bugs plz tell me. I also might try to get the rednet multiplayer mode working...it's got a pesky bug...

Off topic: have u tried the survival feature? It's loads of fun :D
I have and... I LOVE it :3 I will also keep an eagle eye out for bugs(Even though it seems fairly flawless :))
Thanks I am quite proud of it but if you play survival for too long you might have a stroke(I take no responsibility :D )

While I don't think that I would call it flawless(the AI needs work and I want to update the collision detector) i appreciate the complement and cant wait to c skullpong used
Lol, I look forward to seeing a new collision detector(About the only thing that is buggy) but still, no one else has made it so :)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users