? Just random questions to help me make a game (Page 2) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password

Migrating to a new website for SmileBASIC 4

Just random questions to help me make a game

1 2
  • #21 ✎ 1507 rando Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Second Year My account is over 2 years old Website Avatar Taboo I didn't change my avatar for 180 days Website I would use a computer, but mine is freakin' slow Just saying. EDIT: Also what's up with all of this just saying stuff? Posted Edited by rando
  • #22 ✎ 31 legofordmn I don't know. XD Posted
  • #23 ✎ 31 legofordmn Ok, so I have a question. I've written a program where if you push a certain button, it will load a specific Sprite, but after it loads, I want it so if I push other buttons, it will move the Sprite around. How would you do that? Posted
  • #24 ✎ 1507 rando Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Second Year My account is over 2 years old Website Avatar Taboo I didn't change my avatar for 180 days Website I would use SPUSED. So IF SPUSED(sprite number) THEN move sprite ELSE SPSET sprite info Posted
  • #25 ✎ 31 legofordmn Is there a way to do this with using custom sprites? Posted
  • #26 ✎ 84 Jayenkai Look into using the SPOfs command to "Offset" the position of your sprite. Posted
  • #27 ✎ 31 legofordmn Is there a way to convert photos into sprites on SmileBasic 3? Posted
  • #28 ✎ 84 Jayenkai Yes, there is. But it isn't an easy task, if you're already finding the rest of this difficult. Baby steps, learn as you go, but don't try to do the really hard stuff until you're ready. (Don't run before you can walk. Don't fry the fish until you've caught it. etc..) Use your GoogleFu, and see if you can find the solution. But it won't be easy, and you'll likely find it too hard to understand. If you can't, then I suggest you continue your program without the photo, for the meantime. Later on, you might be able to figure it out, but first, work on the rest of the task. Maybe draw a silly smiley clown face, and use that until you can manage the photo stuff. Don't ever let an inability to understand stop you from achieving your goal, but do make sure that you understand the things you're doing. Make yourself little challenges as you go. They help learn things. Try creating a new project, and see if you can rewrite as much of this as you can, without looking back. Train, learn, and you'll gain enough XP to level up and get the photo stuff working! Posted
  • #29 ✎ 16 Chatter Assuming it's a BMP, JPG, or PNG, you can use the tools included with PetitModem (http://smilebasicsource.com/page?pid=812). Posted
  • #30 ✎ 31 legofordmn Is there a way to have something happen when two sprites hit each other? Posted
  • #31 ✎ 16 Chatter
    Is there a way to have something happen when two sprites hit each other?
    Yes. 'Create a sprite and setup collision SPSET MN,PN'Managment number, number on the sprite page. SPCOL MN'Enable collision detection WHILE 1'Game loop COLLISION=SPHITSP(MN)'Check collision IF COLLISION!=-1 THEN GOSUB @COLROUTINE'Branch if it collided with something WEND @COLROUTINE 'Put code here to run when the sprite collides. RETURN The COLLISION variable will give you the management number of the sprite it collided with, so you can, for example, have a block of code execute when it your player sprite collides with a door. If there isn't collision, this value is -1. So, by checking if it isn't -1, you can have code execute any time your sprite collides with another sprite.
    Posted Edited by Chatter
  • #32 ✎ 31 legofordmn What is the simplest drawing program that you can make in a game? Posted
  • #33 ✎ 1507 rando Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Second Year My account is over 2 years old Website Avatar Taboo I didn't change my avatar for 180 days Website Wdym? Posted
  • #34 ✎ 31 legofordmn Like, what is the best way to make a simple drawing program, where if you push a button, a sprite will appear in that spot, and then be able to do the same thing somewhere else on the map. Posted
  • #35 ✎ 1507 rando Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Second Year My account is over 2 years old Website Avatar Taboo I didn't change my avatar for 180 days Website I dunno. Posted
  • #36 ✎ 16 Chatter WHILE 1 IF #UP==BUTTON(3) THEN DEC SLY IF #DOWN==BUTTON(3) THEN INC SLY IF #RIGHT==BUTTON(3) THEN INC SLX IF #LEFT==BUTTON(3) THEN DEC SLX 'Making sure the cursor stays on the screen. IF SLX<0 THEN SLX=0 IF SLX>49 THEN SLX=49 IF SLY<0 THEN SLY=0 IF SLY>29 THEN SLY=29 'Convert tile locations into on-screen coordinates. PX=(8*SLX) PY=(8*SLY) IF #A==BUTTON(3) THEN SPOFS SELSP,PX,PY WEND Also, if you don't know the answer to something, it's best to just not respond. If he's asking a question and you don't know the answer, there's no point in responding to it. It's not helping anyone and it just fills the activity feed with useless posts. A more elegant solution would be to create a tile buffer array (50 by 30), but using this code you should be able to accomplish that without too much trouble. Also, be sure to have some sprite initialization code before this code. Otherwise, it will throw an error. Posted Edited by Chatter
1 2