Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - benwang08

Pages: [1]
1
Graphics / Basic sprite questions
« on: July 01, 2021, 12:07:17 am »
I have a few basic sprite questions i'm a bit new to SFML.

So i want to display some kind of sprite and also be able to detect collisions, this sprite is a sort of abstract shape, with a transparent background in a rectangular png file.

so what would be the best way to go about this, i'm aware of several, I think its possible to just load the sprite into a sprite class, but my question is, would the transparent background be apart of the sprite still? for example, if something collided with the transparent background would that register as a collision to the sprite?

And i've found another way to roughly approximate the sprite with a convex shape, than load the sprite as a texture into that shape, but i was just wondering if this was necessary.

2
General / Help with animating non rectangular sprite
« on: June 30, 2021, 06:20:39 am »
I'm pretty new to sfml, I want to make a simple game.
One thing i'm having trouble with is complex sprites.

For example, in my game I want a cannon shaped sprite (one found online), that moves angles based on the users input. I also want a background, for example a blue sky. I roughly know how to animate a sprite, But as far as i'm aware, its pretty difficult to set the boundaries for complex shapes. If i put the cannon sprite in a basic rectangular shape, then wouldn't there be a rectangular boundary around the cannon sprite? and if I wanted it animated, i'm having trouble figuring out how I could put the background around the cannon, without this border.

If it wasn't animated, I could maybe just put the background inside the sprite itself. But even then, what if I wanted a moving background with clouds or whatnot?

Pages: [1]