SmileBASIC Community
ClaytonDarkClay88
10/11/2016 8:03 PM ·Spoilers
Duplicate Sprites
Is there any way you can duplicate one sprite with different attributes without making a bunch of SPSETS?
Share this Post
Comment
This post has no comments.
-
10/11/2016 9:29 PM ·Spoilers
You would probably have to create a new space, since adding an attribute in the same space would give everyone of that enemy the attributes. So, yea. You're gonna create more space.
Yeahs0 -
10/11/2016 9:47 PM ·Spoilers
There isn't one. However you can make a function to do that with DEF. Here is an example: 1|DEF clone(I) 2| VAR DN=SPCHR(I) 3| VAR X,Y,W,H 4| VAR SP 5| SPOFS I OUT X,Y 6| SPSCALE I OUT W,H 7| 8| SP=SPSET(DN) 9| SPOFS SP,X,Y 10| SPSCALE SP,W,H 11| RETURN SP 12|END
Yeahs1Played -
10/11/2016 9:49 PM ·Spoilers
Here is an example to use that: VAR SP1,SP2,SP3 SP1=SPSET(6) SPSCALE SP1,4,4 SP2=clone(SP1) SPOFS SP2 100,100 SP3=clone(SP1) SPOFS SP3 200,100
Yeahs1Played -
-
10/15/2016 1:08 AM ·Spoilers
raimondz, I need your assistance again. xP I'm having trouble with collision in one of my newer games. I was wondering if you could help me out with it? x)
Yeahs0Played -
10/15/2016 11:24 AM ·Spoilers
I suppose the problem is the collision with walls. I can't explain you right now how it works but I posted a code to handle that case on smilebasicsource. On the search bar type "wall collision" and click on the first result.
Yeahs0Played -
10/15/2016 3:03 PM ·Spoilers
Actually it's sprite collision. SPHITSP to be exact. I have this invisible sprite box that pops out when you press B (but for some reason, if you press any button it will pop out). The box is suppose to hit other sprites but it is not working. I did SPCOL and everything.
Yeahs0Played -
10/15/2016 6:37 PM ·Spoilers
You must call spcol on every sprite that can collide. SPCOL sprite,[Scale adjustment],[MASK] Sprite is the number associated with your sprite. Scale adjustment should be set as true. Mask is a binary variable that let you put category for collision.
Yeahs0Played -
10/15/2016 6:40 PM ·Spoilers
For example, you could have bullets that will collide with the player but not with the enemy, and viceversa. So you can use 2 categories: 1(&B01) = Player bullet var PLAYER_BULLET=&B01 2(&B10) = Enemy bullet. var ENEMY_BULLET=&B10 SPCOL SPEBullet,1,ENEMY_BULLET If you want a bullet that collide with both the player and the enemy, then: SPCOL SPEBullet,1,ENEMY_BULLET OR PLAYER_BULLET
Yeahs0Played -
10/15/2016 6:47 PM ·Spoilers
If you don't put value in mask, then the sprite could collide with everything. ========================== Now SPHITSP let you find the first sprite that is overlapping the one in the argument. This mean if two sprites overlap one in a frame, then the function will return the one with the lowest managment number.
Yeahs0Played -
10/15/2016 6:51 PM ·Spoilers
Almost forgot something about SPCOL: the collider will be a rectangle of the same size as the original sprite. However, you can define a bigger hitbox with SPCOL(See page 3 on the help screen of SPCOL)
Yeahs0Played -
10/16/2016 12:49 PM ·Spoilers
I'm hitting the hitbox sprite with the tree sprite(s) but it's not doing what they computer is telling it to do. :0
Yeahs0Played -
-
10/16/2016 3:46 PM ·Spoilers
That's strange. Can you post a key of your program? maybe I can do something.
Yeahs0Played -
-
-
10/17/2016 4:25 PM ·Spoilers
Well, I found a lot of issues: -From here, if you're creating the same kind of entity(Tree in this case), then use an array to store them and their properties. -You don't need to do SPOFS in the loop if the tree aren't moving. Remember that the camera do that stuff for you. -SPHIT only work if the Sprite is visible. When you're using SPHITSP, the hitbox is already hidden.
Yeahs0Played -
10/17/2016 4:29 PM ·Spoilers
-If you have plans to add enemies or active entities in the future, then you shouldn't use WAIT to handle the punch. That will pause the entire game. I will upload the code later.
Yeahs0Played -
10/17/2016 6:30 PM ·Spoilers
KEY: XRE3C2QV V1.0 and V1.0B are almost the same code. However V1.0B use wait to handle the hitbox but the other use a timer instead.
Yeahs0Played -
10/17/2016 10:16 PM ·Spoilers
Oh wow. I'm dumb. Should've known using wait paused the whole thing. :P
Yeahs0Played
Add a Comment
You must sign in to post a comment.
Sign in using a Nintendo Network ID to connect to users around the world by writing posts and comments and by giving Yeahs to other people's posts. You can create a Nintendo Network ID using your Wii U console or your system in the Nintendo 3DS family.
Report Violation to Miiverse Administrators
You are about to report a post with content which violates the Miiverse Code of Conduct. This report will be sent to Nintendo's Miiverse administrators and not to the creator of the post.
Report Violation to Miiverse Administrators
You cannot report posts made automatically by a software title.






