? Making a shooting game. (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password

Making a shooting game.

  • #1 ✎ 21 Finnow Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Video Games I like to play video games! Hobbies So I'm try to make a game where you shoot stuff, and I'm try to do 360 degree aiming. Like, you point somewhere and the bullet goes that direction. Posted
  • #2 ✎ 292 ProKuku QSP Contest 1 Contest Participant I participated in the first SmileBASIC Source QSP Contest! Night Person I like the quiet night and sleep late. Express Yourself Pokemon Is Awesome! I love Pokemon! Express Yourself @randomous's Simple Bullet Tutorial is probably what you're looking for EDIT: I just remembered that this tutorial only shows how to do shooting in 4 directions. Implementing shooting with the circle pad is fairly complicated to understand, but I know somebody here has already explained the concept on another thread (which I can't find..) Posted Edited by ProKuku
  • #3 ✎ 150 seggiepants Sorry, I don't want to type it all up again, try this link. http://smilebasicsource.com/forum?fpid=25671#post_25671 If you read it and still have questions, or find type-os, please let me know. Posted
  • #4 ✎ 21 Finnow Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Video Games I like to play video games! Hobbies I already know how to do most of it, I just need to know what code I use to make my bullets move properly. Posted
  • #5 ✎ 292 ProKuku QSP Contest 1 Contest Participant I participated in the first SmileBASIC Source QSP Contest! Night Person I like the quiet night and sleep late. Express Yourself Pokemon Is Awesome! I love Pokemon! Express Yourself Well, if that's all you need to know, in seggiepants' code, this DEF UPDATE_SHOVEL VAR X# = SPVAR(CALLIDX, 0) VAR Y# = SPVAR(CALLIDX, 1) VAR HEADING# = SPVAR(CALLIDX, 2) VAR SPEED# = SPVAR(CALLIDX, 3) VAR STEP# = ((SPEED# * DT%) / 1000.0) X# = X# + (STEP# * COS(HEADING#)) Y# = Y# + (STEP# * SIN(HEADING#)) IF X# < 0 OR X# > SCREEN_W% OR Y# < 0 OR Y# > SCREEN_H% THEN SPCLR CALLIDX ELSE SPVAR CALLIDX, 0, X# SPVAR CALLIDX, 1, Y# SPOFS CALLIDX, X#, Y# ENDIF END is the function specifically used for updating the bullets' location. Posted
  • #6 ✎ 21 Finnow Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Video Games I like to play video games! Hobbies So does this take a number between 0 and 360 and make it move the bullet accordingly? I am bad at math, so I do need a bit of help with this. Posted
  • #7 ✎ 150 seggiepants SIN() and COS() want radians (0.0 to 2 Pi ~6.28), and SPROT wants degrees (0 to 360). You can convert Radians to Degrees with DEG(radians) and Degrees to Radians with RAD(degrees). I have heading# in radians in the example code. The # is me saying that the number is a floating point number (it has a value after the decimal point). Posted