ニュートン物理学でゲームを作ろうとしています。
これの残りを読む前に、これが私の主な質問です。私は答えを見つけようとしています:
- コードを実行しようとすると、ウィンドウにポップアップエラーが表示され続けます。どのライブラリまたはdllが欠落していますか?
リンゴ、オレンジ、鉛筆を持っています。ほとんどのドキュメントを弾丸物理エンジンで読みましたが、リンゴを紙のように振る舞わせることができません(2D風)。Box2d物理エンジンなどは、私が望んでいるものではありません。私は、現実の世界では箱は好きではありません。サイバー世界ではもちろんです。
りんごを地面に浮かせて、紙のように前後に揺らしたい。このサイトは、コードに統合したいくつかの有用な情報を提供しました:htp://www.3dbuzz.com/vbforum/showthread.php?50854-Please-HELP !! -Simulating-paper-floating-to-ground
他の種類のオブジェクトと同じようにオブジェクトを動作させるゲームのアイデアはありますが、ゲームのシミュレーションが機能しません。
数え切れないほど多くの種類のリンゴを試してみましたが、どれも近くにはありません。同様のことを試している他の人を検索してみましたが(http://lmgtfy.com/?q=simluating+game+apples+in+real+lifeなどのグーグルを使用して)、リンゴは返されません!
したがって、私はここで新しい領域に入るつもりだと思います(心配しないで、私は自分のテクニックをオープンソースにします)。それが、私にとってうまくいかない理由です。
さまざまな種類のリンゴをプログラミングしてみましたが、サイバーアップルが必要ですか?これらのいずれかをどこで入手できるかわかりません。たとえば、http://cyberapples.com/このサイトは今のところダウンしています-それはcgiのゴミ箱か何かについて話しているだけです。これについて何かヒントはありますか?
これは、ゲームをシミュレートするリンゴを扱う私のコードの一部です。
///... /* setup other objects in the room and other stuff */ ...
// see http://www.orangepippin.com/apples/arlet-swiss-gourmet
// for more arlet apple details
paper_2d_behaving_apple = new ArletApple[);
/ setup the arlet apple's general characteristics
paper_2d_behaving_apple.species = SPECIES.MALUS_DOMESTICA;
paper_2d_behaving_apple.parentage = PARENTAGE.GOLDEN_DELICIOUS_X_IDARED:
paper_2d_behaving_apple.introduced = make_year(1958);
paper_2d_behaving_apple.fruitColor = COLORS.red;
paper_2d_behaving_apple.fleshCOlor = APPLE_FLESH_COLORS::CREAM;
paper_2d_behaving_apple.fruitSize = GENERIC_FRUIT_SIZES.MEDIUM;
paper_2d_behaving_apple.GoodFor.add("eating fresh");
paper_2d_behaving_apple.GoodFor.add("cooking");
paper_2d_behaving_apple.GoodFor.add("use / keeping: 3 months or more");
paper_2d_behaving_apple.GoodFor.add("ripening PERIOD: 3 months or more");
paper_2d_behaving_apple.diseaseResistances = [DISEASE_RES::SCAB, DISEASE_RES::MILDEW];
///... (I cut some of this out for brevity's sake) ...
///* setup this specific apple's characteristics
paper_2d_behaving_apple.base_color = 0xff2000;
paper_2d_behaving_apple.bumpMap = BUMP_MAP_APPLE;
paper_2d_behaving_apple.texture = TEXTURE_REALISTIC_APPLE;
paper_2d_behaving_apple.feel_texture = SMOOTH;
paper_2d_behaving_apple.has_small_orangey_stripes = TRUE;
paper_2d_behaving_apple.DoesntHaveStem = FALSE;
paper_2d_behaving_apple.juicy = true; // needs a lowercase true for some reason
paper_2d_behaving_apple.has_bugs = false; // heck no it doesn't, I only buy good apples
///... (again I cut some stuff out so this post would'n't be too long) ...
// from http://www.3dbuzz.com/vbforum/showthread.php?50854-Please-HELP!!-Simulating-paper-floating-to-ground
// "i think reactor can do this, i would try cloth witha high air resistance and a very high stifness"
paper_2d_behaving_apple.addReactor(REactor());
// got this technique from http://www.gimptutorials.eu/html/clothify_filter_gimp_gnu.html
import gimp ; GIMP::Clothify(paper_2d_behaving_apple); pass
// / 7 should be high enough - it's a big number
paper_2d_behaving_apple.reactor.stiffness = 7.0f;
paper_2d_behaving_apple.reactor.airResistance = 5.0f; // high, but not "very high"
// setup the world the apple exists in
paper_2d_behaving_apple.owner = new BobFlanderson();
paper_2d_behaving_apple.owner.appearance = APPEARANCE_AWESOME;
paper_2d_behaving_apple.owner.clothes.size = CLOTHES_SIZE_MEDIUM;
paper_2d_behaving_apple.owner.owns_house = false;
paper_2d_behaving_apple.owner.apartment.sucks = true;
paper_2d_behaving_apple.owner.has_wife = false;
paper_2d_behaving_apple.viewSpace = LIVING_ROOM;
paper_2d_behaving_apple.RESTINGon = Kitchen.GetSurfaces()->COUNTER_BY_STOVE;
////... (also cut some more out here too) ...
// transform the paper behaving apple into something viewable
view_matrix = new ViewMatrix();
view_matrix.DoTransformation(paper_2d_behaving_apple);
view_matrix.makeViewable();
World->ApplyViewMatrix(view_matrix);
paper_2d_behaving_apple.RenderToNeakedEye();
// THIS IS WHERE I'm HAVING THE TROUBLE
actual_existing_apple_on_myCounter = new ExistingApple(paper_2d_behaving_apple);
actual_existing_apple_on_myCounter.bindInRealLive();
// THIS NEVER WORKS! I DON"T KNOW HOW YOU GUYS DO THIS STUFF!
actual_existing_apple_on_myCounter.Translate(LANGUAGES::ENGLISH);
// saw the IW_FIXED on some jam making site
// (http://www.madewithmarmalade.com/devnet/documentation#/api/api/group__IwGeomCore.html)
// - that's the closest I've come to seeing anything close to what
// I'm trying to do
actual_existing_apple_on_myCounter.TranslateTo(0, 0, IW_FIXED(10.0f));
apple_now_inAir = actual_existing_apple_on_myCounter;
// I know this is C++ code, but some ruby sites were saying that it's best
// to put an exclamation point after a function that modifies a physical
// object - no luck yet for me
apple_now_inAir.Drop!();
ご覧のとおり、基本的な概念はわかりました。変数名とオブジェクト属性については非常にわかりやすくしています。実際のキッチンと比較してゲームの世界を単純化しましたが、私は非常に簡潔かつ明確に世界を設定しました。
問題はをリンゴにバインドし、それを空中paper_2d_behaving_apple
のactual_existing_apple_on_myCounter
リンゴに転送することapple_now_inAir
です();
どのような場合であっても、またすべてを適切にフォーマットしても、何も起こらないようです。以下は、プログラムの実行方法のイメージです。
これまでに誰かに遭遇したことがありますか?前もって感謝します。私はプログラミングゲームを始めたばかりで、最近キャリアを切り替えたので、気を悪くしないでください。
ありがとう、ボブ
apple_now_inAir.Drop!();
は暴動です。この投稿には何かがあります-野心的で、混乱し、運命づけられています...