tag:blogger.com,1999:blog-8979934178906971181.post6823492776012042215..comments2014-06-24T15:01:37.107+03:00Comments on m3ph1st0s' corner: Android games with LIBGDX (4) - gravityAnonymoushttp://www.blogger.com/profile/16345826209743807366noreply@blogger.comBlogger43125tag:blogger.com,1999:blog-8979934178906971181.post-81400514599134659472013-02-26T07:48:18.439+02:002013-02-26T07:48:18.439+02:00Hey Dee,
just stumbled over your comment. Here...Hey Dee,<br /><br />just stumbled over your comment. Here's how I solved the bug in case you don't want this feature ;)<br />Just check if the player is moving upwards or downwards in the part of the update method handling y-axis movement. If the player moves upwards but hits an obstacle the player's still inAir, if the player moves downwards and hits something it's most likely the ground so inAir=false.<br />Hope that helps.<br /><br />Also thanks for writing these tutorials! Keep up the work!Danielnoreply@blogger.comtag:blogger.com,1999:blog-8979934178906971181.post-28475150253470701852013-02-14T21:52:20.536+02:002013-02-14T21:52:20.536+02:00I came across this thread while searching for an a...I came across this thread while searching for an answer to the same resources not found error. I was originally attempting to run the project from the zip folder located at the bottom of this tutorial page:<br /><br />http://obviam.net/index.php/getting-started-in-android-game-development-with-libgdx-create-a-working-prototype-in-a-day-tutorial-part-1/ <br /><br />But in that version not only are the desktop resources not found, the android version doesn't work either because it is depending on the gen folder which is not included in the zip for some reason. I found this page and download your rar which does have the gen folder and now the android works. I am posting because for me the solution to the desktop version not working was to give full paths to the texture initialization instead of just the names of the pngs. Not sure why or what will happen if I ever wanted to make an executable but that's what got it to run for me. Anonymoushttps://www.blogger.com/profile/02379138527257644922noreply@blogger.comtag:blogger.com,1999:blog-8979934178906971181.post-23884768146762086572013-01-30T11:15:33.396+02:002013-01-30T11:15:33.396+02:00Good. In this case it's usually best to use ca...Good. In this case it's usually best to use cam units and let it do all the calculations for you.Anonymoushttps://www.blogger.com/profile/16345826209743807366noreply@blogger.comtag:blogger.com,1999:blog-8979934178906971181.post-53373016656199530322013-01-30T10:53:47.960+02:002013-01-30T10:53:47.960+02:00I was referring to the desktop version, although I...I was referring to the desktop version, although I fixed the problem myself by calling:<br /><br />spriteBatch.setProjectionMatrix(cam.combined);<br /><br />then removing the ppuX/ppuY in the draw calls, as they now work in the cams units rather than pixels.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8979934178906971181.post-84541020009897914192013-01-28T11:29:50.931+02:002013-01-28T11:29:50.931+02:00Did you download my source code? If you did there ... Did you download my source code? If you did there should be nothing wrong. <br /><br /> If you're still on the old code from obviam.net I remember there were some problems I have fixed, problems mainly connected to coordinate miscalculations. Also in my code the view is set for horizontal only.<br /> Or are you referring to the dekstop version?Anonymoushttps://www.blogger.com/profile/16345826209743807366noreply@blogger.comtag:blogger.com,1999:blog-8979934178906971181.post-14596835496118944402013-01-27T17:20:30.361+02:002013-01-27T17:20:30.361+02:00It doesn't seem to resize properly. I think it...It doesn't seem to resize properly. I think it is automatically accounted for somehow and the setSize method in WorldRenderer double counts the resize. Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8979934178906971181.post-18986909769587270442013-01-17T20:10:36.050+02:002013-01-17T20:10:36.050+02:00I imported your project into Eclipse, but it has s...I imported your project into Eclipse, but it has some errors and it crashes immediately as it starts. Haven't had the time to debug it yet (I'm taking some exams for my master's degree these days) but I'll look into it this weekend.Anonymoushttps://www.blogger.com/profile/16345826209743807366noreply@blogger.comtag:blogger.com,1999:blog-8979934178906971181.post-21082482333637612122013-01-17T20:07:56.137+02:002013-01-17T20:07:56.137+02:00Haha that's a misspell dating back months ago ...Haha that's a misspell dating back months ago (when I created the project in Eclipse). It shouldn't matter anyway. <br /><br />Did you do just this: <br />1.Download my .rar <br />2.Extract it to a folder (let's call it BOGDAN) somewhere on the disk (NOT in the Eclipse workspace)<br />3.Start Eclipse, close all projects<br />4.File -> Import ---> Existing Projects into workspace<br />5.Browse to the folder BOGDAN/star-assault; the project inside will be automatically detected. CHECK the "Copy projects into workspace" before clicking Finish! It's important<br />6.Do the same for BOGDAN/starT-assault-desktop.<br />7.File-> Import -> Existing Android projects into workspace<br />8.Same thing as above in the folder BOGDAN/star-assault-android<br />9.Run the app<br /><br />If you did EXACTLY that and it's still not working, all I can think about is a problem in library version or maybe java version. Or maybe even OS (I have Win7 x64) who knows.Anonymoushttps://www.blogger.com/profile/16345826209743807366noreply@blogger.comtag:blogger.com,1999:blog-8979934178906971181.post-19815349555064983072013-01-17T19:20:59.023+02:002013-01-17T19:20:59.023+02:00I did not suceed with the setup tool... Creating a...I did not suceed with the setup tool... Creating and running the empty project works, but when i try to use it with the data from star-assault it shows the same error again -.-<br /><br />But i saw that the "star-assault-desktop" folder in the .rar Bodgan put up is named "starT-assault-desktop"... Can you look into that again?<br /><br />Thanks Rickhttps://www.blogger.com/profile/05168390844311480965noreply@blogger.comtag:blogger.com,1999:blog-8979934178906971181.post-56126638281289353532013-01-12T18:41:18.489+02:002013-01-12T18:41:18.489+02:00Rick, if I were you I would download the libgdx se...Rick, if I were you I would download the libgdx setup tool, its on aurielon ribbons blog (sp?) It will create your folders and downloads the source for you, etc. Create a project with it, run the project it should show a background w/ libgdx info. If it doesn't you need to uninstall eclipse and set it back up, as well as the android sdk. Also make sure you're using java 1.6 not 1.7 heard that screws stuff up before. If the proj you make with libgdx does work, then you can put the star assault packages/classes into it and tie them to the main class of the project.Anonymoushttps://www.blogger.com/profile/15411958717513298883noreply@blogger.comtag:blogger.com,1999:blog-8979934178906971181.post-54071129558044941302013-01-12T14:48:39.907+02:002013-01-12T14:48:39.907+02:00Unfortunately it did not, i am still getting the s...Unfortunately it did not, i am still getting the same error as before, i even downloaded libgdx again and linked the libs all new, but that did not work either...Rickhttps://www.blogger.com/profile/05168390844311480965noreply@blogger.comtag:blogger.com,1999:blog-8979934178906971181.post-66467314844515480832013-01-11T23:05:09.296+02:002013-01-11T23:05:09.296+02:00Done, thanks!Done, thanks!Anonymoushttps://www.blogger.com/profile/15411958717513298883noreply@blogger.comtag:blogger.com,1999:blog-8979934178906971181.post-6729640005613082802013-01-11T22:01:59.052+02:002013-01-11T22:01:59.052+02:00I modified the link at the end of the post. Downlo...I modified the link at the end of the post. Download again and import the project into Eclipse from scratch. Let me know how it works.Anonymoushttps://www.blogger.com/profile/16345826209743807366noreply@blogger.comtag:blogger.com,1999:blog-8979934178906971181.post-42795123194407846392013-01-11T21:57:55.684+02:002013-01-11T21:57:55.684+02:00Pack it up with WinRar and send it to my email: bo...Pack it up with WinRar and send it to my email: bogdan.alexandru.314@gmail.comAnonymoushttps://www.blogger.com/profile/16345826209743807366noreply@blogger.comtag:blogger.com,1999:blog-8979934178906971181.post-31790762743267084962013-01-11T20:48:25.755+02:002013-01-11T20:48:25.755+02:00Bogdan,
How would i send you the project? via go...Bogdan,<br /> How would i send you the project? via google plus? I don't use it much at all so I'm not exactly sureAnonymoushttps://www.blogger.com/profile/15411958717513298883noreply@blogger.comtag:blogger.com,1999:blog-8979934178906971181.post-64112040021382435682013-01-11T18:39:55.615+02:002013-01-11T18:39:55.615+02:00Thanks! Keep in touch thenThanks! Keep in touch thenAnonymoushttps://www.blogger.com/profile/16345826209743807366noreply@blogger.comtag:blogger.com,1999:blog-8979934178906971181.post-89817971516857359152013-01-11T17:44:05.006+02:002013-01-11T17:44:05.006+02:00Many thanks for this. I am following your tutorial...Many thanks for this. I am following your tutorials with great interest. Keep up the good work !Robert Smithnoreply@blogger.comtag:blogger.com,1999:blog-8979934178906971181.post-35072437229970095862013-01-11T17:24:03.309+02:002013-01-11T17:24:03.309+02:00Hi,
First thing should be easy to fix. Implementin...Hi,<br />First thing should be easy to fix. Implementing a turning animation is not hard but it requires some work.<br /><br />Send me the full project so I can load it and see what modifications need to be made.Anonymoushttps://www.blogger.com/profile/16345826209743807366noreply@blogger.comtag:blogger.com,1999:blog-8979934178906971181.post-76556229105103862302013-01-11T17:11:44.210+02:002013-01-11T17:11:44.210+02:00Hey Bogdan,
Nice tutorial! I was wondering if ...Hey Bogdan, <br /> Nice tutorial! I was wondering if I could send you some of my code? I've got animations working for left and right walking, but when I do the left walk, the sprite disappears and reappears about 20 pixels to the left. This is because of the width of the sprite and the width of my player class (bob). Do you know how to fix this? <br /> Also, I've set up a boolean for whether or not the player is changing direction (so I can show a turning animation) I can't determine what to do for this test, I tried to make an if statement that included the isFacingRight boolean, but don't know how to get it to check for a negative deceleration just after the player is facing right?Anonymoushttps://www.blogger.com/profile/15411958717513298883noreply@blogger.comtag:blogger.com,1999:blog-8979934178906971181.post-3514532931487335682013-01-11T11:07:50.452+02:002013-01-11T11:07:50.452+02:00Ok, thats nice, because the phone version isn'...Ok, thats nice, because the phone version isn't working either ^^Rickhttps://www.blogger.com/profile/05168390844311480965noreply@blogger.comtag:blogger.com,1999:blog-8979934178906971181.post-79788767577038431402013-01-11T10:44:12.280+02:002013-01-11T10:44:12.280+02:00So the phone version is working fine? If so, it...So the phone version is working fine? If so, it's all good since I stated in the beginning of the tutorial that I am interested only in the Android application.<br /><br />However, since you are clearly also interested in the Desktop version (and since it should work anyway as it's using the same sources and resources) I'll try to give you a hand. I'll look over the code tonight to see why this error could appear to you.<br /><br />At first glance, I am pretty much sure there's something wrong with your folder structure. Have you rebuild the project from scratch?<br />Note that your exception is actually an error. This means that the method specified was there in the code during compilation and everything was fine until runtime when sudenly the method could not be found. The referenced InputProcessor class is different from what you actually have in the code.<br /><br />My guess is you need to download the latest version of the LWJGL library again.<br /><br />This evening I'll upload the entire project with all the links and libs (all 3 folders) to start from 0.Anonymoushttps://www.blogger.com/profile/16345826209743807366noreply@blogger.comtag:blogger.com,1999:blog-8979934178906971181.post-79829775993911703592013-01-11T10:18:18.733+02:002013-01-11T10:18:18.733+02:00Ok, i found out how to link it in the original tut...Ok, i found out how to link it in the original tutorial part 1.<br />Now the error is gone, but i keep getting another one when i start the desktop version.<br />It shows the game window for a brief moment then it crashes and i get these errors:<br /><br />http://pastebin.com/GcKTJdan<br /><br />Thanks in advance ;)Rickhttps://www.blogger.com/profile/05168390844311480965noreply@blogger.comtag:blogger.com,1999:blog-8979934178906971181.post-33108300262758479672013-01-11T01:30:42.521+02:002013-01-11T01:30:42.521+02:00I re-linked the assets folder in star-assault-desk...I re-linked the assets folder in star-assault-desktop to the asset folder in star-assault-android using "new folder" and the link feature of eclipse. It still gives me the same error as before.Rickhttps://www.blogger.com/profile/05168390844311480965noreply@blogger.comtag:blogger.com,1999:blog-8979934178906971181.post-77865351443504189072013-01-11T01:04:31.618+02:002013-01-11T01:04:31.618+02:00I don't know what is your folder structure. I&...I don't know what is your folder structure. I've double checked now and it appears that in my project the pictures are in the assets folder in the star-assault-android folder. The assets from the star-assault-desktop folder is just a link to the first one.<br /><br />So this means that if you extracted my folders it should work for you. It works for me in both phone and desktop. <br /><br />MAKE SURE that the assets folder from the star-assault-desktop folder is a link to the assets folder from the star-assault-android folder. If that's done then it must work on desktop.<br /><br />Why it crashes on your phone I don't know. You need to copy/paste me the LogCat error messages.Anonymoushttps://www.blogger.com/profile/16345826209743807366noreply@blogger.comtag:blogger.com,1999:blog-8979934178906971181.post-38256476689725623002013-01-11T00:42:09.963+02:002013-01-11T00:42:09.963+02:00I did exactly that, but it is not working. All 3 s...I did exactly that, but it is not working. All 3 star-assault folders are direclty in my workspace.<br />I thought all the assets have to be in the android folder for creating the app... Isn't that right?Rickhttps://www.blogger.com/profile/05168390844311480965noreply@blogger.com