(评论)
(comments)

原始链接: https://news.ycombinator.com/item?id=40582357

啊,谢谢。 我停下来,回到这里,看到这个评论,然后回去,让球过去。 好吧,说实话,我不小心提前取消了暂停,在我有机会思考我是否有足够的领先优势之前他们就过去了。 我做到了! 最终得分 405,我的得分与机器人的得分之差。 我喜欢这些评论// 欢迎来到全局变量和不一致命名的土地。//// 抱歉:速度有点老套的猜测;// 命名几乎到处都是可怕的;// 这段代码可能有 85.2% 的错误 // 注意:我使用的 // “左”在画布坐标中是 -x;// “上”在画布坐标中是 -y;// 理想情况下,对象的 (x,y) 一致意味着 ( left,top).//// 注意:noyb2 字体只有大写字母,// 带有一些小写图标。

相关文章

原文


Very cool!

The physics seem very different from classing pong / arkanoid physics, where the angle is determined by which part of the paddle was hit. Instead it seems like it's maybe totally random within a fairly small cone around the horizontal axis. Is that intentional?



I've never "studied" "paddle dynamics" in these games, and when implementing pong, always just reflected, which doesn't provide good game play, but pong is always a "I'm trying out a different framework" type exercise.

Pong using where it hits to affect the angle never totally made sense to me. I assume the explanation is "the paddle is drawn as a rectangle, but is actually parabolic." Additionally, I've always wondered why I've never seen a pong where the paddles have acceleration to some maximum velocity, and if the paddle is not stationary, you get lateral spin, causing non-linear ball paths on the return hit.



> Pong using where it hits to affect the angle never totally made sense to me. I assume the explanation is "the paddle is drawn as a rectangle, but is actually parabolic."

It doesn't have to be realistic, only fun. The justification (very much not an explanation) is that it is more fun if the player can affect the angle of the rebound by positioning the paddle.

It's also not realistic for Mario to change his jump's arc after he leaves the ground but the "rule of cool" holds in the Mushroom Kingdom, too.



Well yes, of course. The way the different angles are computed isn’t intuitive. If a ball bounces off a table, it doesn’t change direction from its normal reflected bounce just because it didn’t hit the center.

That’s why I’m suggesting there must be something that guides the idea that hit position changes the angle. If the paddle was actually parabolic, and just drawn as a rectangle, that’s an intuitive reason for the different reflective angles.



> That’s why I’m suggesting there must be something that guides the idea that hit position changes the angle.

Fun. The guiding principle for all games should be: is it fun?

The reason the position of impact determines the angle is because it’s more fun, Not because it’s realistic.

Realism is rarely fun.

It’s a game, not a physics simulation.

Edit:

Additionally, if you only implement perfect reflection and have a rectangular arena, then the only bounce angles that can occur are the initial ball angle A and 90 - A on the top and bottom sides. That’s not fun.



I love Arkanoid and other pong-alikes, so also I'm curious about seeing how deflection angles on paddle location hit would play. Great design, music and play!



In that case I think the strategy would be to create a lead and then let all the balls through so that the game ends. At the start I was winning but at some point I wasn't able to keep up anymore.



Ah, thanks. I paused and came back here, saw this comment, then went back and let the balls go by. Okay, I'll be honest, I accidentally unpaused early and they went by before I had a chance to think about whether I had enough of a lead. I did! Final score 405, the difference between my score and the bot's.



I didn’t know it was when no balls were left. So this time I got an initial game, jumped ahead after using a special, then let all balls pass. I won by two points! :)



I was thinking "okay I think I am about done with this, I am at 2.5k to 2k", and then the game spawned a "defend" powerup for the computer player, which blocked off the entire computer side with destroyable blocks, and I decided I was done. 2721 to 2167.

Cute idea, could be kinda fun with another human, maybe with some way to push a button to lose points in exchange for a powerup on your side?



Challenge 1: Win the game with the lowest lead you can get. Or tie.

Challenge 2: Win the game with the least number of points; total points, before the bot's points are subtracted.

My first attempt at this (which was my second game) I won with 442 - 405 = 37.

EDIT: Second attempt, this time on mobile: 43 - 35 = 8



Awesome game! Best pong variant I've played!

Would be great to have an end goal. I managed to maintain a 200pt lead up to 1300pts and decided to give up cause I didn't know how long it would go.



As I learned from other comments, the game ends when all the balls are out of play. Whoever is in the lead wins, and your final score is the amount of the lead. So you can allow the balls to get past you and go out of play to end the game, but make sure you have enough of a lead first!

Hmm, next I'll see how low of a score I can have and win the game.



It wasn't until I read the comments that I actually gave it a chance. Would love to see a "Oh, you think it's Pong? It's not!" indicator on the page.



Holding down one arrow key and only pressing the other makes directional changes much quicker, since the second press overrides but doesn't cancel the first.

Very fun!



I liked it but would suggest maybe changing the orientation so you can use left/right instead of up/down. i was playing way better once i rotated my keyboard so i could use two fingers



That was really cool. Nice of you to include a warning, but I wish there was a light-theme mode (or may be there was one and I missed it).



Very cool. You can control the paddle with the mouse by holding left click. I missed that my first playthrough and used the arrow keys.



I thought it would go on forever but I made it 'till the end.

Final Score: 2071 - 1715 = 356

Damn I did pretty good against GPT, it seems like AI still has so much to learn from humans :)



At first the CPU was beating me as it could jump around to get more of the balls returned, but once it was thick enough I pulled ahead as I seemed better able to aim for returning the big clusters.



I love these comments

// Welcome to The Land of Global Varibles, And Inconsistent Naming.

//

// sorry: velocities are kinda hacky guesstimates;

// the naming is horrible just about everywhere;

// this code is probably like 85.2% bugs or bad taste.

//

// note: my use of

// "left" is -x in canvas coordinates;

// "up" is -y in canvas coordinates;

// ideally (x,y) of objects consistenly means (left,top).

//

// note: the noyb2 font only has upper case letters,

// with a few icons in the lower case.



My progression: Ok. Oh it’s like that? I got you. Oh fuck you. Oh fuuuuck you!!

Love this. Really need a paddle input device on the iPhone.

联系我们 contact @ memedata.com