Simple procedure generated map - logic

I'm developing a game, and i just faced a logic problem, a little bit annoying...
Here's the deal: imagine a scenary:
Where the black square around the player is the camera view, and the red dots, are the randomly generated objects
the game is something like angry birds, its a physics game, which you trhow the object, so, the player is always going foward to the right, how can i make
to the game always generates the red dots and disable the older ones that they are no longer visible? keep in mind that the camera always follows the player, and i don't want that the player notices the instantiation
Here's a gif to understand a little bit more:
http://i.imgur.com/0Ku8g2P.gifv
i just need some other opinions to make this happen, its just a logic problem haha
Thank you very much!
sorry for my bad english!

Related

Skeletal animations in C# SFML 2D

I'm completely green when it comes to skeletal animations in 2D. I create a platform game and I got graphics for it - body parts from which to stick the character. My problem is that I have absolutely no idea how to go about it. The question is: How do you implement animations in the game?
I could do it frame by frame from previously glued body parts, but I need the character to look at the mouse cursor, so it falls off. I am asking for some ideas.
About your problem, if you want all parts of your character look at the mouse, you should rotate your character, if just a part (like character's head) you need to rotate the head.
I could give you some methods to implement animation that I known
Draw animation frame by frame: simple, easy to approach and handle but hard to scale up.
Separate character into many parts and each part has a unique animation: flexible, good for scale up but hard to handle due to you must ensure all parts are stick together in a right way (from scratch without tools or engine). I think this video may help you to know more the way their create skeletal animation in Unity (same as Spine).
Hope it help.

Joint for physical gun slider?

I want to make it so when I fire my gun the slider shoots back and then comes forward like a real gun. However I don't know how I should start because I can't find any relevant information on Google and I don't know what to search. All I need is the logic behind how to do it, I can code it myself.
I would agree with zambari.
Just create an animation and play it when your guns gets fired.
Edit:
Since you are talking about 3D, you could either
move the pivot of the object to the point where the trigger would be attached. This way, all you need to do is change the objects rotation for the animation.
use joints
This is the best tool for VR guns with interactable parts. I HIGHLY recommend looking at this to ANYONE making a VR game
https://github.com/Oyshoboy/weaponReloadVR

Unity 3D and Mixamo Animation -- Feet Inside of ground

I have a weird problem I can't figure out. I'm new enough to Unity 3D I have a hard time even posing the questions sometimes.
Take a careful look at this picture where I drew the red circles:
The problem is that both in the actual game and in the animation preview, this Mixamo character, using the Mixamo running animation, shows her feet under the ground. Actually, this is a problem with all animations. She does NOT start out under the ground (and in fact starts above ground.) But when the game runs, she falls to the ground (well, she doesn't really fall since she has no ridge body. She appears suddenly at level 0, which you'd think is right on the ground, but in fact it shows her a foot or two under the ground), and the animation then plays with her too low. She doesn't have a ridged body, so that is not the problem.
You can also see my settings for the animation. I've played around with all of them and can't fix it. This happens whether or not I apply root motion or foot IK.
Is there a way to 'lift' the animation up so that it is right on the ground?
I just found an issue in Unity. When i kept the T-Pose Model (Skinned) in a folder and the animation of it in another folder then the Animations turn out to misbehave. Like Legs twitching or parts of body going down. When I brought the T-Pose and other animations together in one folder and updated the reference in Rig of T-Pose then all became normal.
One shitty basic problem is just:
There's an obscure setting actually on "Layers" in Animator, on the "base" layer you have to explicitly turn on "IK Pass".
Only in very unusual situations would you want this "off", just another bizarre mistake by Unity.
Reimporting fixed the problem. I do not know why. It seems that when you play with the animations, they sometimes get corrupted.

Player-Sprite with hat/robe/staff for each direction?

Some friends and I started to create a game, in which a mage will be in the center of the screen, being able to run in all 4 directions (as it is a 2D game)+diagonals, so 8 directions total (so the level below the player is moving).
The mage should wear a hat, a robe, and a staff for now, of which there should be a hole lot more than just one.
Additionally the mage should have a walking animation of let's say 3 pictures.
So overall it would be:
8(directions)*3(walking animation)*k(hats)*n(robes)*m(staffs) = 24*k*n*m sprites
(Which are currently BufferedImages as PNG with alphachannel drawn on a canvas), which is like waaaay too much for my designer (because we want a hole lot of staffs, robes and hats, maybe later even add boots and stuff)
So my idea was to make a "naked" playersprite and have separate sprites for staffs, robes and hats, which I then just render on top of the player.
Is that a good idea, or am I missing anything that would make all that a hole lot easier?
Combining sprites to draw the player is the way to go. You can reduce the amount of work more if you sacrifice some details.
You can mirror the animation for left and right. The weapon is always in the players hand facing you (instead of e.g. always in the player's right hand)
You can omit diagonal walking animations. Just reuse the horizontal or vertical animations.
Some games even omit the vertical walking animations, meaning you always see the player from the side even though you can walk up. It may interferes with the game mechanics if you can't attack up or down.
If the sprites are high res enough, you can keep static items as one single sprite and move/rotate them with the player's animation. So every weapon (or weapon type) has the same animation for walking, attacking etc. Probably doesn't look to good in retro style games because it won't be pixel perfect.
Reuse sprites. Not every robe needs a new design, just change some colors.
If you plan on finishing the game, detailed sprites and animations should be the last thing you implement. Make an ugly prototype first and if it is fun, then you can still add more details and make it look good.

Simple leg animation in Farseer Physics

I'm using XNA 4.0 with Farseer Physics 3.5 and would like to do a walk animation like seen in the game "Ibb and Obb" http://www.youtube.com/watch?v=2iif636QAcc. However there are many different animation when they're changing direction, standing still etc. I'm more than happy to be able to duplicate the run/walk animation
The player consists of, afaik, three bodies; the main body, and two leg/foot bodies. However I can't figure out which joints to use to make the legs move in a similar fashion.
Any Farseer/Box2D guru that might have an idea where to start, I'm clueless atm. Thanks!

Resources