I am trying to develop helix jump in Cocos creator 3.4 but I don't know how to make it smooth
When I try to use setWorldRotationFromEuler it moves the tower but when I click on same position it moves back to initial touch pos.
input.on(Input.EventType.TOUCH_MOVE
, function(touch){
this.node.setWorldRotationFromEuler(0 ,touch.getLocationX()/2 ,0)
},this)
input.on(Input.EventType.TOUCH_MOVE
, function(touch){
var qout1=Quat.toEuler(new Quat,this.tower.getRotation())
this.node.setWorldRotationFromEuler(0,(qout1.y+touch.getDeltaX()/3),0)
},this)
}
this will resolve the issue
Related
I am developing the HoloLens app using Unity2018.3.1 and MRTKver.2017.4.2
At first, I could use MRTK exsamples' script "Interactive.sc" etc. without problem in AirTap series operation, but OnInputClicked (InputClickedEventData ecentData) of IInputClickHandler came to be called twice by AirTap once at a time .
I'm wondering if MRTK should be reintroduced or the code should be reviewed and rewritten
Can you check if InteractionInputSource.GestureRecognizer_Tapped() is called more than once for each air tap?
I've been getting my feet wet with Python and Pygame, and after a few bugs in a very basic game that I have been making, I've thought to myself that having some sort of console that can deal with string input (from a developer) would be very handy.
Here's an example:
I notice the player disappears after double jumping. So, in the console that I will hopefully create, I would type in:
>> report_bug("Player disappears after double jumping")
Where report_bug(string) is a user-defined function that will do the following things:
report_bug(string):
# Check if debug file already exists; create new file if none exists
# Append string to file, along with other extra info
Could someone point me in the right direction? Will I have to create something from scratch, and if so, how would I go about doing that? I've attempted to modify the source code from: http://www.pygame.org/project-pygame-console-287-.html, however it is 9 years-old and made for Python 2.x, when I'm using Python 3.4. Any help would be greatly appreciated.
I've managed to get the 2.X PygameConsole version 0.7 working, so I will stick with that!
Edit: I will attempt to port PyConsole to Python 3.X and hopefully add some more features so newcomers can easily understand what is going on.
I'm trying to get my game to automatically set the window size as the correct resolution for the monitor.
For example, my desktop PC is at 1920x1080 resolution, so I want my game to run at 1920x1080 on here, however my laptop is at 1366x768 so I want my game to run at 1366x768 on there, etc.
I've tried so many different things such as GraphicsDevice.Adapter.CurrentDisplayMode.Width/Height, and even printed out the list of GraphicsDevice.Adapter.SupportedDisplayModes and they all tell me that the only display mode supported for me is 800x600. This is surely not the case, because I'm running my Windows 7 at 1920x1080.
So what on earth am I doing wrong? I tried putting this code in the Game1 constructor, the initialiser, I can't figure out why it isn't working properly!
Okay I fixed it. I just realised I was being a little bit stupid in that I forgot to mention this a "MonoGame" application, not a straight forward XNA project... (I didn't think it would make a difference but oh I was wrong)..
As it turns out, MonoGame has a massive bug to do with the graphics devices, and there is supposedly a way to solve it (build from the latest source or something?) but what I did was install the XNA 4.0 Refresh for Visual Studio 2013, and copied all my source code across to a new XNA project as opposed to a MonoGame project.
And hey presto, GraphicsDevice.DisplayMode.Width and Height are now correctly registering as 1920 and 1080 pixels. So now I can carry on with my game FINALLY.
Thanks to all the people that tried to help me solve this issue!
You can set the resolution of your game in the constructor by adjusting the graphics' PreferredBackBufferWidth and PreferredBackBufferHeight:
For example this will produce a game window that's 480x320:
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
graphics.PreferredBackBufferHeight = 320;
graphics.PreferredBackBufferWidth = 480;
}
Keep in mind that when in windowed mode your game will (by default) have a title bar which prevents the game window from being as big as your full screen.
This is my method on how to get your maximum supported resolution(and set it, as an example to clarify it):
// in the Initialize method
graphics.PreferredBackBufferWidth = GraphicsDevice.DisplayMode.Width;
graphics.PreferredBackBufferHeight = GraphicsDevice.DisplayMode.Height;
graphics.IsFullScreen = false;
graphics.ApplyChanges(); // <-- not needed in the Game constructor
However, I don't know what you're doing wrong.
I'm having some trouble using OpenAL in cocos2d v3. Here's some context:
What I'm using: Xcode 5 + cocos2d v3 + iPhone 5 (iOS 7).
What I want to do: Create a multi-audio-source scene with positional audio (just pan + volume for now).
Why didn't I use OALSimpleAudio? Couldn't get the various sources to change pan and volumes as the listener moves.
What have I done so far? I have loaded an ALBuffer with an audio file and queued that buffer in a ALSource. When I run the code, nothing ever plays. Right after the [soundSource play:soundBuffer ...] line, I have checked if the sound was playing with [soundSource playing] and got a negative response. Also tried to instantiate an ALListener, with the same position as the source, but nothing changed.
Any help regarding this problem would be appreciated. Any suggestions about what different approaches I should be looking forward to are welcome as well.
Thank You!
in the version r56 of three.js this was working
geometry.verticesNeedUpdate = true
in the new r58 version it is not, what should I do?
The migration docs explain API changes between versions:
If you are using BufferGeometry, geometry.verticesNeedUpdate has been changed to geometry.attributes.index.needsUpdate.