SKPhysicsJointFixed is not binding two nodes together - ios

I'm teaching myself swift while recuperating from back surgery and everyone's help has been awesome while I'm learning swift. I apologize if this seems super simple but I figure it might help the next guy.
I've read the Apple Documentation on fixed joints and was struggling to get this to work.
You will notice that the joint is present but doesn't lock the two together.
This seems like a simple fix (and is) but hopefully this will help someone.
When you are adding your joint the documentation shows:
joint(withBodyA:bodyB:anchor:)
For this to work you need to make sure you enter in your sprite to be joined as the "withBodyA" body.

My "bad" joint:
let jointFixed = SKPhysicsJointFixed.jointWithBodyA(zombie1.physicsBody!, bodyB: zombie2.physicsBody!, anchor: z1.position)
self.physicsWorld.addJoint(jointFixed)
The fix is to make sure the sprite you are joining to is the first variable:
let jointFixed = SKPhysicsJointFixed.jointWithBodyA(zombie2.physicsBody!, bodyB: zombie1.physicsBody!, anchor: z1.position)
self.physicsWorld.addJoint(jointFixed)
As always, triple reading the documentation is the key.

Related

Detect if someone is noclipping or flying(Roblox Lua)

So, I am making a game that is highly sensitive to hackers and if someone did hack it, it would be completely ruined. Is there any possible way to detect if someone is flying/noclipping and kick them using Roblox Lua scripts??
I found this answer on the devforums, but if a player is noclipping, they have no hitbox, meaning you can raycast from the HumanoidRootPart, and if that ray can't see the player, then they are noclipping however, some false positives may occur with laggy players so beware.
Anway the devforums are a better place to get your answer so go there instead.
i have not made anything in roblox before, so this might not work
one way to detect flying is the check the y of the player:
if y > 100 then -- y can be replaced with other variables, and i recommend you change 100 to another number
-- ban
end
you can also apply this to x and z.
this solution however only works if the player flies to a certain point, so you might have to get creative, i'll edit this answer when i finish reading the documentation
another way is by making an object out of bounds, when the player collides with this object it bans them.
that is all i can think of, let me know if you have any problems!

ModelingToolKit - PDESystem: Boundary conditions and Domain for arbitrary geometry

I am quite new to Julia so I maybe missed the proper documentation.
Is it possible to define a PDESystem in ModelingToolKit with symbolic BCs and Domain for arbitrary geometry?
For instance, if I want to solve the 2D Navier-Stokes equations with a PINN in the following period-hill shape with a curved ground:
How can I defined a no-slip boundary condition on the ground and how can I limit my y-axis to range from y/H = ground(x) to y/H=3 ?
Thanks in advance!
That just doesn't exist right now. The PDESystem parts are still under very active development.

What is a VGroup in manim?

Could you explain to me what is a VGroup and how is it useful, please? I tried looking for it, but obviously to no avail, not much documentation there is. Thanks in advance.
It is basically a group of VMobjects. So say you have some equation consisting of multiple seperate Texmobjects. Then you want to move the entire thing. It would make sense to VGroup all the parts, so let entire_eq = VGroup (eq_part1, eq_part2, eq_part3) and then you would just have to move this entire_eq. This also applies for changing the colors, scaling and so fort.
This works for any kinds of VMobject.

How to do a "transition.to" to a value

So here is my problem,
I want to use the easing algorithm of the transition.to function to have a smooth transition of my physics Time Step when the game is lost.
So far I've just set the value to 1/300:
physics.setTimeStep(1/300)
It's been 2 days of useless searching efforts..
I tried a lot of things but anything relevant..
I simply do not know whether or not it is possible..
Thanks!
Well after three days of searching finally found that on GitHub :
Robert Penner's Easing Library Lua Port
Hoping it will help someone else ! ;)

CGPointFromString, but for OS X

I'm trying to follow a tutorial for making an iOS game in SpriteKit, but also simultaneously porting it to OS X. (When I'm making my own game, I intend to do exactly that, plus it helps the learning sink in a little bit more than just copying spoon fed code)
So far, everything has gone spritely (pun intended) and I've been able to troubleshoot or research every problem I've come across, but alas, it could only last so long. It's probably something stupid simple too, but it evades me.
I'm trying to pull in a string from a plist dictionary
self.position = CGPointFromString( [ characterData
objectForKey:#"StartLocation"]);
StartLocation is the key for the coordinates, in the format of "{0,0}".
When building for iOS, it works beautifully. When building for OS X, it fails. I believe the issue lies with "CGPointFromString" being unique to the iOS development environment. It only appears in iOS documentation. The thing is, I can't find any OSX equivalents.
I realize that I could PROBABLY get it to work by breaking the coordinates into two float values with two separate dictionary entries for x and y, but I don't know if the writer of the tutorial did this intentionally and that would break something down the road, plus I want to know how to convert from one data type to another on OS X too.
Please help! /Thank you!
On OSX you have NSPointFromString but not CGPointFromString. You also have NSPointToCGPoint and NSPointFromCGPoint if you want typecast them.
Not as direct but this works:
NSPoint cocoaPoint = NSPointFromString(theString);
CGPoint point = NSPointToCGPoint(cocoaPoint);

Resources