i am trying to build a game in which the player moves along the terrain which has ups and downs. I also want the background to move in the opposite direction of the player movement. How to achieve this ?? Here the player is moving in Xaxis and Yaxis like Ski Safari game and camera is moving with the player. Please help.. Thank you in advance.
There are several ways you can do this, I would suggest this: http://answers.unity3d.com/questions/19848/making-textures-scroll-animate-textures.html
You could also use Fractal Textures, Unity3D provides an example of this in their procedural generation example on their website: http://u3d.as/content/unity-technologies/procedural-examples/3zu
Related
I am working on just a small game in Vb.net (I know this is not a great place to make a game but I'm just doing a little project). I have a project set up where I am trying to make an isometric tile map. To make it easier on myself, I wanted to get all the locations set first, so I took picture boxes and found the exact locations for where I want to draw each tile. Now what I would like to do is draw an image at each location and I'm not sure how to go about this.
(something like, for each picturebox.location draw graphics.tile1????)
thank you!
So, how can I do this?
For example, my person goes right and camera starting to move to persons coordinates with acceleration, when he stoppes - camera moves to persons coordinates with deceleration. Of cource, I can make it by myself, but is there any library that can help me with it?
I'd suggest using Universal Tween Engine. You could add a short deleay and proper math equations to smooth out the camera transitions.
http://www.aurelienribon.com/blog/projects/universal-tween-engine/
What is the best way to make sand particles animate in a view?
Essentially, I would like to half fill the iOS device's screen with small sand-like particles, then allow a user to rotate and shake the device to dictate the sand's position.
Assuming I have never done any physics programming before, can anyone recommend a tutorial or show me how it's done?
Thank you,
Query.
UPDATE:
I have now come across this (mine should be 2D though) - how can I bring something similar into my app?
Using spatial indexing for finding the nearest-particles to check for collision and using an integration technique for the transition between force(acceleration)-velocity-position and using only gravity force as an outer-fource would give you your sand-box.
You will need to select a good exclusion-force derived from a particle-potential if you use post-collision detection.
I advise you to use the Truncated Lennar-Jones potential and Verlet-Integrator. Easier than Runge-Kutta's and more precise than Euler's. Because it is used in molecular-dynamics. You dont need to use other forces . Just use exclusion force, gravity and wall forces.
If you have bullets in your simulator, you can use Euler-Integration for them. I think this is acceptable for free-falling but not colliding sand particles. After they close each-other, it would be good to use Verlet or Runge-Kutta.
All i mentioned above assumes your integration step is so big that energy is not conserved and even decreased. If your integration is good enough to conserve energy, you will need to give your particles friction force to make sands slow or you will get your particles exploding everwhere.
If you like to make it on iphone then you have to think of certain optimizations and tricks as iPhone can't really simulate water or sand.
Your trick is that most of your work is to draw scene.
Create scene in Box2D with balls at size 10-20 times bigger then sand particle.
iPhone would be able to simulate it.
Then you should draw 10-20 sand particle per ball.
Every frame you may check if ball collides with other balls or not.
If balls is not colliding then these sand particles are in the air and you should draw them on certain distance one from each other.
If ball collides with other balls then particles should be rendered together
You may also detect margin and render glider sand border on top.
I want to create a bubbles like game in android and I'm not sure how to draw the graphics.
Should I use canvas ? Every bubble should be a bitmap or maybe an image view ?
Another thing, I want to be able to rotate / scale the bubbles.
I've tried with bitmaps and canvas but wasn't able to rotate the bubbles.
Image view for every bubble looks like a mess to me.
Your help is appreciated.
Thanks
If you want to make a game, I would suggest using a Canvas, and put the Canvas over most, or all, of your layout. Creating anything but the most basic game using the regular UI structures would be a nightmare.
It sounds like you've gotten to the point where you can load the bubble images and draw them to the canvas, which is good. As for rotating the bubbles, use this:
Matrix rotator = new Matrix();
rotator.postRotate(90);
canvas.drawBitmap(bitmap, rotator, paint);
That was from an answer to this SO question, which was more specifically about rotating bitmaps on a Canvas.
For more information on making games in Android, this book was pretty helpful for me.
Hope that helps!
I m developing one game in cocos2d but i have one doubt, in this game i have one background and above that i want to add one slope image and i want to move the sprite(vehicles) on that slope randomly just like this game i m giving the link of one game, please suggest me how i can implement just like this video, I also want to make the game just like this.
http://www.youtube.com/watch?v=yMJFRd3bBhw
Thanks in advance,
One option is using a path and make the sprites follow that path, define that path for each terrain. Another option is using a physics engine, you can do that using the engine itself (i think).