Dragging with inertia in AS3 for dummies - actionscript

I'm trying to create an inertia effect for dragging that's constricted to the x axis. I know this questions was asked before here but I couldn't understand the answer!
I'm currently using startDrag and stopDrag. I'm assuming I should add something to the startDrag function that captures the speed in which the user is moving the mouse, but I'm not sure how this is done. I guess then I'd add something to the stopDrag function that kicks in and makes the object keep moving at that speed and then come to a stop.
Any suggestions?

I've found an grat online tutorial that has the answer. I was a matter of tinkering with the code. The writer even has .fla files for download.
http://www.quasiuseful.com/?id=11

Related

is there a way to make a cursor that doesn't dissapear quickly on a roblox game?

So, i was working on a simulator game in roblox studio and my inspiration for the game had a different cursor than the actual in roblox, so i watched a tutorial on how to change them, and it quickly fade. so i watched more tutorials and i found none way to make it happen, all just didn't work somehow, but the code that probably (and most of the tutorials i learned) were like this:
local mouse = game.Players.LocalPlayer:GetMouse()
mouse.Icon = "rbxassetid://12158273870"
Can you find the solution or a page that tells you how to do this on a Local Script? That would be appreciated!
I first tried the tutorials with a decal, which failed, and then, with a texture, which also failed.
So i lost my hope on making a cursor, i was using this decal:Goblocks Cursor (Decal) and then this texture:Goblocks Cursor (Texture) .
Can you find the solution for the decal? if not, then you can do the texture.

Making a Platform game with Corona SDK

I'm trying to develop a platform game similar to Geometry Dash but i'm facing a lot of problems during the making of the algorithm.
I don't barely know how to proceed. Are the levels structured with a long image ( that is the ground) with obstacles added, or there are many obstacles generated progressively during the game?
I'd like to know where to start from, what to draw and how to place it in my game, how to build the collision detection.
The game will be an auto-scrolling platformer, so, will the character's asset be moving right or will all the level except for the character be moving left?
I'm a beginner, so i would like to receive detailed answers and not too difficult to understand. Thank you.
if you have any advice I would gladly listen to it.
I've done all corona tutorials but they doesn't explain how to do a platformer. - Luca Pasini
Looks like you still don't feel how game work from inside. Tutorials probably will not help you much. I think you need to start something very simple by your own - not by tutorials.
For example:
Show red rectangle
Show blue recatngle
Tap on the screen and red rectangle must change his position (not by transitions - just by core x,y change)
If they are collide - show text: "You win". Collision check just by raw calculations.
Then go with updates, that will make it looks more like a game.

How to move "obstacle" objects. Corona SDK Physics Box2D. Physics Update?

I'm trying to understand the proper way to move "obstacle" objects in corona/box2d. I want to know how to write my code so that the movement is deterministic and in-step with the physics engine. Is this possible?
I'm familiar with Unity which has a physics update (FixedUpdate). Where you can add a bit of code to execute on every physics step. This keeps the physics deterministic, frame and system time independent.
For example, in my game I want to do things like: Make a platform that moves back and forth, make an object that scales up and down in size. I would still like the physics to work properly and allow the ball in my game to bounce off of these for example. Depending on the case, I imagine that I should use either kinematic or dynamic bodies.
I've searched around and the way to periodically manipulate these objects is to use:
timer.performWithDelay. But this has an issue mentioned in the docs "Timers run on system time. If the app is suspended, running timers will not be automatically paused"
Listening to an enterFrame event. But this has a similar issue, if the frame rate drops then the object won't be moved enough. We can use delta time to deal with this, but this has determinism issues (moving an object too much on a lag spike).
transition.to. I'm guessing this is implemented with timer.performWithDelay and has the same issues.
I don't think that any of these will behave deterministic. Any suggestions? Thanks for the help.
You should really use:
object:setLinearVelocity(xVelocity, yVelocity)
or
object:applyForce(xForce, yForce)
instead of transition.to.

How can i improve the performance of my app(swift) that seams to struggle

I made an app that uses a custom UIDynamicBehavior but i have problems with performance. So the game i wrote has a circle in the middle of the screen and there are little circle dots "flying" out of the middle in random directions to the border of the circle. I have about 4-5 circles on the screen at the same time at most and the frames are already droping. I have also tried using multithreading but i get some weird errors i dont understand so im presuming i was using it wrong. Does anyone have any experience with that? Can someone help me please? In the file you see a function "lunchBall", that gats called about every second or so. Thank you. Here is the file: https://www.dropbox.com/s/hbf2qux47zhd9ap/BallDynamicBehavior.swift?dl=0

How do I make players on Roblox spawn as different objects?

For example: In my game I want player to spawn as a ball? How will I accomplish this? I can't find it anywhere on the web, though I have searched and searched. I haven't got any code because I haven't the simplest idea of how to do this. Thanks for your help!
First things first; You'd probably have better luck over at https://scriptinghelpers.org/questions it's like Stack Overflow but for only Roblox related questions.
now, if you want the player to spawn as anything other than the default player, you have to do one of two things, prevent the character from loading, or remove it when it does, once you've accomplished that, you should bind the camera to the desired object, and bind movement to keys.
an easier, but much less elegant solution would be to find and modify a standard character morph to simply make it appear that you're a ball.

Resources