Motion framework - create repeating animation? (CosmicMind) - cosmicmind

Firstly, thank you for the great frameworks (Material and Motion) and generally awesome documentation.
I have been migrating to various Material and Motion classes in my app and enjoying it, but i have a situation I can't quite figure out an elegant way to handle with Motion.
I like to have a repeating background pulse animation that triggers on an IBAction and stops on an IBAction, but motion animations are 'one shot', and im not sure how to trigger a long running animation (unknown duration, repeating) and keep a handle on it, then stop it.
Is this a paradigm supported by Motion?
Thank you

Related

Smooth look_at() in Godot

I am working in GDScript, and I'm trying to get the player to aim their weapon in the direction of the mouse cursor. The look_at() function is great, but it's not the smooth movement I'm looking for.
So, instead I've been experimenting with the lerp() math operation to make it smooth... but its very jittery and buggy movement which is obviously not ideal.
func _process(delta):
`rotation_degrees = lerp(rotation_degrees,rad2deg(get_angle_to(get_global_mouse_position())),aim_speed)
`
1 See the image of my code here.
I can't work out if I'm doing something really stupid as I'm fairly new to Godot. Any help would be massively appreciated!
Please use_physics_process() instead of _process()
_process runs at the fastest possible rate whenever it gets the CPU. That makes it jittery. It is not ideal for player movements since you will need consistency in your frames.
_physics_process() is consistent as it is frame independent and is ideal for player movement.
if you want more details I recommend you check this video by Godot Tutorials
Btw look_at() should work just fine :)

How to get the position of a different object in gdscript?

I have a player, and I want to be able to detect when they are near a ball so they can press 'E' to kick it.
I'm new to godot and I'm probably just dumb but I can't figure out how to get the position of another object.
I have 3 separate scenes: MainScene(Node2D), Player(KinematicBody2D), and Ball(RigidBody2D). I want to attach a script to one of the scenes that detects how close the Player is to the Ball so they can kick it.
I'm not sure if I should attach the script to the MainScene, the Player scene, or the Ball scene and to be honest, I'm not entirely sure how the code should look. I'm not very familiar with the functions and the node/scene hierarchy is a little confusing.
I am familiar with Python, I just think I'm overwhelmed with this engine (its my first time using a game engine) and I'm having a bit of a tough time grasping it.
Any help would be greatly appreciated!
Side-quest: If you are feeling extra helpful I also need to figure out how to stop a RigidBody2D object from moving until the player hits 'E' on it to kick it!
For this you want an Area2D, which is purpose-built for "detecting nearby objects" without interacting with them physics-wise. Have an Area2D as a child of the Player node and connect the Player node to that Area2D's body_entered signal. Here's a tutorial on using Area2D for further info; this tutorial also links to various other tutorials that could be helpful.
i think you maybe use function
get_overlapping_bodies()
(of Area2D node) for detect another areas or body

VS2012 CodedUI Recording: How to handle MouseWheel?

I have recorded a set of actions on a UI with the integrated Coded UI Test Recorder. It works kind of nice.. actually, right now I am going through the code and adding some polling for .Enabled and recently found the .TryGetClickablePoint which seems to be really useful. So it looks like recording is a breeze now (with those few polls to be added to get the timing right).
One thing that is a typical use case of the GUI is using the mouse wheel (for interacting with a zoomable image like in google maps). It seems like those are not captured.
I could manually generate those events, but would be far off from reproducing the actual behavior during recording with manually guessing the extent of the scrolling.
Is there some integrated way?
Would I have to capture the events myself with some external/selfmade tool to at least get an idea of how many ticks I made?
For stuff like this I'd recommend using the API directly for your test. You can use the Mouse.MoveScrollWheel method for this. You might have to experiment a little to get the number of ticks right.

Animated sprites using Awe6 game framework

I am looking for a way to have an animated character in my game. I would like to have a running animation loop when he is running, a jump animation when he jumps etc.
Does the awe6 framework provide anything like this? Maybe using spritesheets, or separate images for each frame.
If I have to use my own system, are there any popular libraries that can help do this, and that work well with awe6? And how would I use it with the framework?
awe6 is not something that works out of the box but rather an architecture for you to build on. It is not designed to fill your requirements without work from you and requires you to have at least a good understanding to integrate another framework/target runtime for what you want. They do have a wiki however you can start with http://code.google.com/p/awe6/wiki/QuickStart
There are many popular frameworks out there that have a lower barrier to entry, such as haxepunk.com, haxeflixel.com, https://github.com/aduros/flambe they all have their own strengths/weaknesses etc for you to decide on and can all easily complete your requests.

How to read Location of a view whilst it is being animated

I am animating a small space ship (derived from UIView) and periodically (whilst in animation) send it a PointF to check if this is near the space ship's current position.
However, when reading out the Frame position of the View it keeps returning the starting position before the animation started.
I think this is by design but it is causing me big problems since the space ship(s) should move independently along Paths and it is very tricky for me to do this by hand.
Is there another way - and/or has anyone some sample code?
Not sure of a workaround for your issue, but I have some suggestions on game development for iOS.
Your problem is one of the reasons why using GUI frameworks like UIKit/CoreGraphics for games isn't a good idea. For both performance reasons, as well as the fact as they aren't designed for it.
If you are looking for a simple framework for making games on iOS, have you looked at MonoGame? If you are doing lots of animations, we also use XNA Tweener along with MonoGame to get some lifelike animations.
PS - check out our game here.

Resources