# edgarllorente

Members

4

103 Neutral

• Rank
Newbie
1. ## Game like "Tiny Wings" or "Dragon,fly!"

I have been doing some math about it, and what I need to solve is how to get a formula that gives me how much pixels the object has to advance in a certain time, something like "x = x0 +vt + 0.5*t*t" but for the wave. The wave is generated by a formula that looks like this: "f(x) = A(x)*sin(x * (360/waveLongitude) )" where A(x) is the amplitude in that point generated by a formula. The problem is how to get a new formula that return the x giving to it the time
2. ## Game like "Tiny Wings" or "Dragon,fly!"

Hello I'm trying to make a terrain like the one on those games, I mean a terrain that is a wave that keeps changing and where the object keeps oscilating. I've never done anything like this before and for now I got a reasonable success... I managed to draw a wave like that by varying the amplitude of the wave every point... more o less this is the resoult: [img]http://s16.postimage.org/5mkvn3pth/Captura.png[/img] To make the object follow the wave is easy, its just getting the amplitude of the y of the function that draws my wave and drawing it there... My problem comes when I try to apply physics, although I thought I managed to do it I realized I don't... when the physics are calculated within miliseconds the object moves little by little, but when applied for a second or so it moves more than 1000px So... I wondered if someone can help me appliying the physics to this wave... Edgar
3. ## Android tutorials?

If you are new to Java I encourage you to begin programming in Processing (processing.org) it is a programming language based in java (basically it uses java with a lot of things pre-made), it is a perfect language for starting to learn the basics of Java. Here you have some tutorials that I found very interesting and useful when I started to develop for Android: [url="http://www.vogella.de/articles/Eclipse/article.html"]http://www.vogella.d...se/article.html[/url] -- tutorial for installing the Eclipse IDE [url="http://www.vogella.de/articles/Android/article.html"]http://www.vogella.d...id/article.html[/url] -- tutorial for setting up the eclipse IDE to program for Android (And a introduction to developing on Android) [url="http://mobile.dzone.com/articles/beginning-android-game"]http://mobile.dzone....ng-android-game[/url] -- Making a sprite with Android On this tutorials you will also find how to set up the SDK for developing for the device you want to. By the way if you are planning to develop in Java try to be used to Eclipse, it's a widely used IDE for developing in Java. (Sorry my bad english) [quote name='c0080900v' timestamp='1323923946' post='4894072'] [quote name='NuliNuli' timestamp='1323877695' post='4893868'] 1. learn Java 2. learn android [url="http://developer.android.com/resources/tutorials/hello-world.html"]Hello world[/url] 3. use some engine to design and build your game. If it is physics 2D you can use [url="http://www.andengine.org/"]http://www.andengine.org[/url] if its If you don't care about learning java you can use Javascript or C# and learn Unity 3d [/quote] [center]What site would you recommend for learning Java online?[/center] [/quote]
4. ## Problem with collision detection

Hello, I am making an application in C++ with OpenGL, by the moment my program loads the worls and it's objects so now I'm trying to implement the collision detection with the walls. The method I am aplying now is to calculate the distance between the camera and the line that every wall forms, by the way this system has a great problem and it is that detects a collision all the way the line actually the wall forms, so I tryed to make the distance between a segment and a point, but it doesn't work. struct segmento { float x1, z1, x2, z2; float A, B, C; }; struct colisiones { segmento *colision; int numcolisiones; }; float distancia(float x, float z, segmento *origen) { return (origen->A*z+origen->B*x+origen->C)/sqrt( (pow(origen->A, 2) + pow(origen->B, 2)) ); } int comprobar_colision(float x, float z, colisiones *origen) { float u; for (int a = 0; a < origen->numcolisiones; a++) { if (fabs(distancia(x, z, &origen->colision[a])) < 0.2) { float x1 = origen->colision[a].x1; float x2 = origen->colision[a].x2; float z1 = origen->colision[a].z1; float z2 = origen->colision[a].z2; u = ( (x-x1)*(x2-x1)+(z-z1)*(z2-z1) ) / pow((x2-x1),2)+pow((z2-z1),2); if (u>0 && u<1) return 1; } } return 0; } First the function "distancia" calculates the distance between the camera and the line that the wall form, then "u" is one formula that I read in a tutorial that it's suposed to return a value between 0 and 1 if the especificated point is inside the segment both points of the wall forms, but it doesn't work. Can someone help me please? Thanks a lot =)