TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Simple 2D car physics with JavaScript

308 点作者 pkstn超过 5 年前

27 条评论

minikomi超过 5 年前
Happy new year, everyone<p><a href="https:&#x2F;&#x2F;imgur.com&#x2F;a&#x2F;AIxvWUh" rel="nofollow">https:&#x2F;&#x2F;imgur.com&#x2F;a&#x2F;AIxvWUh</a>
评论 #21927679 未加载
评论 #21927565 未加载
wiz21c超过 5 年前
not 100% related but is there any good information source on the web to learn how to build a good car simulator ? I&#x27;ve looked around and it&#x27;s not very helpful. Usually I end up with physics courses which always repeating the same things. But not much about about : pneumatic (especially how they influence the overall speed), independent wheel modelling, suspension, mass shift, frame deformation, ...<p>I&#x27;ve checked the source code of torcs but it seems quite simple (although the results are very convincing).<p>My goal was to model a (indoor) kart.
评论 #21928446 未加载
评论 #21929003 未加载
评论 #21928498 未加载
评论 #21929007 未加载
评论 #21928438 未加载
LoSboccacc超过 5 年前
&gt; multiplayer<p>before you venture there I suggest you move the control code outside of the physic code, abstracting car inputs into a throttle, brake, steer structure which is piloted by inputs elsewhere and feed into the physic update tick along with the car state, or it&#x27;ll make exceptionally hard to build input prediction and lag compensation further on
评论 #21927759 未加载
评论 #21927894 未加载
评论 #21927816 未加载
samwillis超过 5 年前
Love it. Reminds me of playing with similar car simulations in Flash when I was at school.<p>Now just make it isometric with collision detection and use maps built with this (currently also on the front page):<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=21923940" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=21923940</a>
评论 #21927425 未加载
评论 #21927280 未加载
评论 #21930463 未加载
评论 #21927174 未加载
niix超过 5 年前
This is great and inspiring. Every few months I spin up a socket.io server and attempt to make an RPG. I get about as far as having the character move around the screen and then usually give up :D
评论 #21928138 未加载
评论 #21928489 未加载
joemaller1超过 5 年前
Project page: <a href="https:&#x2F;&#x2F;github.com&#x2F;pakastin&#x2F;car" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pakastin&#x2F;car</a>
eitland超过 5 年前
That is totally amazing! Have played it for 5 minutes on my phone now :-)
评论 #21927157 未加载
fjfaase超过 5 年前
How long would it take to make the whole screen one color (excluding the red car)? And what is the best strategy: driving in circles or fast alternating between gas and brake?
评论 #21927901 未加载
nkrisc超过 5 年前
I see that it works on mobile but u can not for the life of me figure it what the control scheme is. I just touch the screen and the car and to randomly move.
评论 #21928260 未加载
tomxor超过 5 年前
I love how instantly hackable this is... clone the repo and serve the directory localy and still connects through websockets, no npm crap in the way. :)
评论 #21929240 未加载
评论 #21928759 未加载
trekhleb超过 5 年前
The physics is really nice! Played with it for couple of minutes and even managed to drift&#x2F;draw &quot;2020&quot; trace on the ground :D
评论 #21927530 未加载
mechhacker超过 5 年前
That&#x27;s pretty cool! Just fooling around with this made me think about replicating it with an Elixir backend.
评论 #21928767 未加载
40four超过 5 年前
Great work @pkstn! Works surprisingly well on a touchscreen. Really enjoyed deck of cards as well :)
评论 #21927977 未加载
n-gauge超过 5 年前
Good work! Q: How well would multiplayer work if you used webRTC data sockets instead?
评论 #21928494 未加载
smcl超过 5 年前
I spent more time than I care to admit zooming around on this page
评论 #21927764 未加载
kmjoshi超过 5 年前
This is very cool and fun! and its only one page of js code!
评论 #21927528 未加载
wahlis超过 5 年前
Wonderful! Please add some sounds for drifting :)
评论 #21927765 未加载
cabaalis超过 5 年前
Networked spirograph simulator :)
评论 #21928509 未加载
alexchamberlain超过 5 年前
This is nice. It would be cool to have an option of rendering the controls under my thumb?
评论 #21927369 未加载
Spacemolte超过 5 年前
Nice, but I do feel like it&#x27;s missing a set of tracks from the other set of wheels.
评论 #21927373 未加载
pkstn超过 5 年前
Multiplayer is live now!!! :D
评论 #21927914 未加载
planetis超过 5 年前
Nice, can we get tracks too?
评论 #21930976 未加载
marius_k超过 5 年前
I like it how those patterns reveal different screen sizes&#x2F;resolutions.
评论 #21928483 未加载
ashisrai_超过 5 年前
Drifting is awesome.
评论 #21927766 未加载
jakciewell超过 5 年前
it&#x27;s pretty cool and fun
评论 #21927563 未加载
citrons超过 5 年前
Nice!
评论 #21928032 未加载
djmips超过 5 年前
It&#x27;s fun! Nice work.
评论 #21927371 未加载