
NITWIT
Members-
Posts
9 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
NITWIT's Achievements
Newbie (1/14)
2
Reputation
-
Thanks Ivan, I'll dig into these links tomorrow when I get a minute. If anyone else wants to share, I'd love to hear how all you people animate your sprites.
-
I'm wondering what the best way to animate a sprite is. Is there a basic example or tutorial out there somewhere? I have ten images in a spritesheet that are part of an idling animation, and I made a texture for each of the images. I put the textures in an array, and my plan is to just change the texture of my sprite each frame in the gameloop, looping through the array of textures over and over again. Maybe using Sprite.setTexture ??? Is that a good way to go about it? Any links to info or tutorials would be much appreciated. Thanks,
-
ivan.popelyshev reacted to a post in a topic: Best way to make the camera follow a sprite?
-
I'm a newb, so don't listen to me. But I'd try attaching your mouse event handlers to bunnies.bunny instead of just bunny? Maybe the mouse events aren't triggering because it's just hitting the container instead of the bunny sprite.
-
ivan.popelyshev reacted to a post in a topic: Best way to make the camera follow a sprite?
-
I want to make the camera follow my sprite around. (so my sprite is always in the center of the screen) What's the best way to go about this? Does Pixi have built-in camera functions? I thought about just moving everything else relative to my sprite, but I thought this wouldn't be the best way. I googled around a bit, but with no luck. Any tips or resources would be much appreciated. Thanks.
-
NITWIT reacted to a post in a topic: stage.removeChild() not working as expected
-
NITWIT reacted to a post in a topic: stage.removeChild() not working as expected
-
.Thanks Ivan, I know my code is a mess. I'll clean it up and I imagine that will fix a lot of bugs. To be clear, I don't think there's a bug with Pixi -- it's definitely on my end. I guess I'm just wondering what the removeChild() function does exactly. For example, If I create a sprite and give it an x position. mySprite.x =100; And then I remove the sprite. stage.removeChild(mySprite); And then I ask for mySprite's x position. console.log(mySprite.x); Would the browser still know the x position? Would it print 100 to the console? or undefined maybe? Does the browser keep data about a sprite even after you remove it? Sorry if these are really dumb questions. Maybe there's a Pixi newb section I should post to instead. Thanks!
-
Hi, I'm just getting started with Pixi. I made a little sprite that walks around and shoots things. Whenever I bump my sprite into the bad guys, I want him to disappear. So I ran stage.removeChild(mySprite) and he disappeared! But... He still shoots when I click and he still moves around with WASD. So it just makes the sprite invisible? Here's a link: http://www.med.wadholm.com/Kaitlyn/sprites/pixi/bunny/
-
Maybe check this out too. It's more on the hitTestRectangle() function. https://github.com/kittykatattack/bump