? Making a Shoot 'Em Up Game, but still with some doubts. (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password

Making a Shoot 'Em Up Game, but still with some doubts.

1 2 3 4
  • #1 ✎ 302 the_squat1115 Minecraft Is Awesome! I love Minecraft! Express Yourself Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies Hi, I'm recently working on a Shoot 'Em Up game called Galaxy Blaster (Probably I could change the name), because I got some knowledge by digging on that GAME4SHOOTER game, because I wanted to make a modification of it. But ended up with this. Here is what I've learned: LAY=0 'Layer of the BG to scroll, think like LAY=[NUMBER]. BG0Y=-3 'Speed of the BG, depending on the style of Shoot 'Em Up you want, vertical or horizontal. BGOFS [LAY],[code, code, code] [code, code, code] But everything left are: ●Maps made with DATA ●Enemy generating with DATA ●Collision detection ●Boss engine and mechanisms Tell me if something had passed up from me. Posted Edited by the_squat1115
  • #2 ✎ 1284 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 Forum Leader Hidden Achievements Interesting. I probably could answer a few of your questions, but I don't want to lecture. I guess for maps with DATA, you have a BG table array. DIM BGTABLE%[10]'This can have any number, 10 is used in this example. You also have a map data array (string array). Like so: DIM MAPL0$[15] It has an element for each 16x16 horizontal strip, here is a diagram to demonstrate what I mean: 1:■■■■■■■■■■■■■■■■■■■■■■■■■ 2:■■■■■■■■■■■■■■■■■■■■■■■■■ 'all the way to 15 We will come back to this array when reading the map data. You can set these values to what ever background tile number you want them to be; 0, 1, 5, 57, 294, 1016, or any other tile you want to use. Then with DATA you write your maps with whatever you represent them as. I would recomend doing this with character codes that increase by 1 each time. It could be 1234567890 or ABCDEFGHIJ or anything that works like that. One way you can make sure you are going in the right order is with CHR$(). Like ?CHR$(57) 'prints character ?CHF$(58) 'prints next character So you have your map data. It could be something like this: DATA "0000000000000000000000000" DATA "1000008000000000000000000" DATA "3100076700000000000040000" DATA "2100008000005000000000000" DATA "1000000000000000000000000" but it could also be anything else. Before you have your map data you can have BG table data, to set your BG table. Like this: 'BG TABLE DATA DATA 375'BGTABLE[0] DATA 376'BGTABLE[1] DATA 465'BGTABLE[2] DATA '... 'MAP DATA DATA "0000000000000000000000000" DATA '... So reading all of this is kinda interesting. Before the data, you might want to put a lable, so you can easily do multiple maps: @MAP0001 DATA '... So anyway, in reading this, you put RESTORE "lable name": RESTORE "@MAP0001" It doesn't need to be a string, and people don't usually make it a string; with strings it's easier to comprehend receiving data from another slot: RESTORE "1:@MAP0001" Then you would read your bg table with something like this: FOR I=0 TO LEN(BGTABLE)-1 READ BGTABLE[I] NEXT And then you would read your map data. It would be something like this: FOR I=0 TO LEN(MAPL0$)-1 READ MAPL0$[I] NEXT That's fairly simple. Displaying the map is a bit more complex. To display it, you could do a lot of things. But this is the way I learned how to display the map, so use it and study it as you wish. FOR I=0 TO LEN(MAPL0$)-1 FOR J=0 TO 24 IF ASC(MID$(MAPL0$,J,1))>=[the lowest character code] && ASC(MID$(MAPL0$,J,1))<=[the highest character code] THEN BGPUT I,J,BGTABLE[ASC(MID$(MAPL0$,J,1))-[lowest character code]] NEXT NEXT I got kinda messy in displaying that code, but I'm sure it still at least slightly illistrates what I'm trying to say. Lots of string functions, lots of frustration :) I love string functions Posted Edited by rando
  • #3 ✎ 302 the_squat1115 Minecraft Is Awesome! I love Minecraft! Express Yourself Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies
    We will come back to this array when reading the map data. You can set these values to what ever background tile number you want them to be; 0, 1, 5, 57, 294, 1016, or any other tile you want to use. Then with DATA you write your maps with whatever you represent them as. I would recomend doing this with character codes that increase by 1 each time. It could be 1234567890 or ABCDEFGHIJ Or something that works like that. One way you can make sure you are going in the right order is with CHR$(). Like CHR$(57) 'prints the character CHR$(58) 'prints next character So you have your map data. Something like this: DATA "000000000000000000000000" [...]
    I could try this, if I can. Posting results when I'm ready!
    FOR I=0 TO LEN(BGTABLE)-1 READ BGTABLE[I] NEXT
    This just comes with me with a type mismatch. Help please? EDIT: nvm, it just fixes when I put the string ($) symbol. EDIT 2: It doesn't generates the map for some reason, just comes with an error...
    Posted Edited by the_squat1115
  • #4 ✎ 1284 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 Forum Leader Hidden Achievements
    This just comes with me with a type mismatch. Help please? EDIT: nvm, it just fixes when I put the string ($) symbol.
    NO don't make it a string. You need to create the variable as an array: DIM BGTABLE[10]'Any number can go inside, 10 is a good one though not a string.
    Posted
  • #5 ✎ 302 the_squat1115 Minecraft Is Awesome! I love Minecraft! Express Yourself Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies
    This just comes with me with a type mismatch. Help please? EDIT: nvm, it just fixes when I put the string ($) symbol.
    NO don't make it a string. You need to create the variable as an array: DIM BGTABLE[10]'Any number can go inside, 10 is a good one though not a string.
    I just get a type mismatch on line 46 or something... Where it's reading the BG Table.
    Posted Edited by the_squat1115
  • #6 ✎ 1284 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 Forum Leader Hidden Achievements What exact code is there? Did you put all the BG tiles BEFORE your map data? The data should be like @MAP0001 DATA 18'BGTABLE 0 DATA 28'BGTABLE 1 DATA 47'BGTABLE 2 DATA 384'BGTABLE 3 DATA 375'BGTABLE 4 DATA 294'BGTABLE 5 DATA 373'BGTABLE 6 DATA 928'BGTABLE 7 DATA 264'BGTABLE 8 DATA 546'BGTABLE 9 DATA"0000000000000000000000000 DATA"0000000000000000000000000 DATA"0000000000000000000000000 DATA"0000000000000000000000000 DATA"0000000000000000000000000 Posted Edited by rando
  • #7 ✎ 302 the_squat1115 Minecraft Is Awesome! I love Minecraft! Express Yourself Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies
    What exact code is there? Did you put all the BG tiles BEFORE your map data? The data should be like @MAP0001 DATA 18'BGTABLE 0 DATA 28'BGTABLE 1 DATA 47'BGTABLE 2 DATA 384'BGTABLE 3 DATA 375'BGTABLE 4 DATA 294'BGTABLE 5 DATA 373'BGTABLE 6 DATA 928'BGTABLE 7 DATA 264'BGTABLE 8 DATA 546'BGTABLE 9 DATA"0000000000000000000000000 DATA"0000000000000000000000000 DATA"0000000000000000000000000 DATA"0000000000000000000000000 DATA"0000000000000000000000000
    The DATA ones are tiles? Testing it...
    Posted Edited by the_squat1115
  • #8 ✎ 1284 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 Forum Leader Hidden Achievements
    [...] I could try this, if I can. Posting results when I'm ready!
    FOR I=0 TO LEN(BGTABLE)-1 READ BGTABLE[I] NEXT
    This just comes with me with a type mismatch. Help please? [...]
    This Code generate the Error because BGTABLE after LEN is not defind. You only have defind BGTABLE[Map%] So try FOR I=0 TO LEN(BGTABLE[Map%])-1 READ BGTABLE[I] NEXT Dont forget to set "Map%" as a Number before using. (You can also use "Map$" - its youre choise.)
    what no BGTABLE is an array containing the data for which tile is represented by what. I believe that the error was generated because it read map data (strings) into the bg table (numbers) because the bg tiles weren't set before the map data. Therefore, it skipped straight to the map data and didn't like the strings.
    Posted Edited by rando
  • #9 ✎ 1284 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 Forum Leader Hidden Achievements
    @random_god If you create a array like BGTABLE[10] you can use it only if you type it correctly. Otherwise a error will show (with OPTION STRICT) or it will not work. Of course you can use a variable and a array with the same name, but this makes things harder to debug. In this case: The code try to read this Data-lines: "0" , "-1". Data-line "-1" is not possible = Typ mismatched.
    I don't get what you are saying. If the problem is if you type it wrong, that's the case with everything. I will make a demo program to show what I mean. KEY: REMOVINATED sorry just look at it
    Posted Edited by rando
  • #10 ✎ 302 the_squat1115 Minecraft Is Awesome! I love Minecraft! Express Yourself Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies
    @random_god If you create a array like BGTABLE[10] you can use it only if you type it correctly. Otherwise a error will show (with OPTION STRICT) or it will not work. Of course you can use a variable and a array with the same name, but this makes things harder to debug. In this case: The code try to read this Data-lines: "0" , "-1". Data-line "-1" is not possible = Typ mismatched.
    I don't get what you are saying. If the problem is if you type it wrong, that's the case with everything. I will make a demo program to show what I mean. 7K3KQ3NX just look at it
    Thanks! I just copied the code to mine and it works! Thanks, random_god!
    Posted
  • #11 ✎ 1284 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 Forum Leader Hidden Achievements
    @random_god If you create a array like BGTABLE[10] you can use it only if you type it correctly. Otherwise a error will show (with OPTION STRICT) or it will not work. Of course you can use a variable and a array with the same name, but this makes things harder to debug. In this case: The code try to read this Data-lines: "0" , "-1". Data-line "-1" is not possible = Typ mismatched.
    I don't get what you are saying. If the problem is if you type it wrong, that's the case with everything. I will make a demo program to show what I mean. 7K3KQ3NX just look at it
    Thanks! I just copied the code to mine and it works! Thanks, random_god!
    Make sure to study the code too, so that you know how it works.
    Posted
  • #12 ✎ 302 the_squat1115 Minecraft Is Awesome! I love Minecraft! Express Yourself Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies
    @random_god If you create a array like BGTABLE[10] you can use it only if you type it correctly. Otherwise a error will show (with OPTION STRICT) or it will not work. Of course you can use a variable and a array with the same name, but this makes things harder to debug. In this case: The code try to read this Data-lines: "0" , "-1". Data-line "-1" is not possible = Typ mismatched.
    I don't get what you are saying. If the problem is if you type it wrong, that's the case with everything. I will make a demo program to show what I mean. 7K3KQ3NX just look at it
    Thanks! I just copied the code to mine and it works! Thanks, random_god!
    Make sure to study the code too, so that you know how it works.
    Just left the sprite ones, but thanks for the help. I'll study it ASAP.
    Posted
  • #13 ✎ 1284 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 Forum Leader Hidden Achievements
    ~SNIP~ Just left the sprite ones, but thanks for the help. I'll study it ASAP.
    Sprites are pretty simple. If it's auto-scrolling, on the exact pixel when it reaches the edge of the screen you set the sprite. This is kinda hard to explain, so I will upload the key to a thing similar to this that I have made. KEY: QDV4338D (credit to GAME4SHOOTER because of the map part of the first section) so yay
    Posted Edited by rando
  • #14 ✎ 302 the_squat1115 Minecraft Is Awesome! I love Minecraft! Express Yourself Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies
    ~SNIP~ ~SNAP~ Just left the sprite ones, but thanks for the help. I'll study it ASAP.
    Sprites are pretty simple. If it's auto-scrolling, on the exact pixel when it reaches the edge of the screen you set the sprite. This is kinda hard to explain, so I will upload the key to a thing similar to this that I have made. KEY: QDV4338D (credit to GAME4SHOOTER because of the map part of the first section) so yay
    Thanks, random! EDIT: Litterally, I don't know how to use SPDEF.
    Posted Edited by the_squat1115
  • #15 ✎ 1284 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 Forum Leader Hidden Achievements
    ~SNIP~ ~SNAP~ Just left the sprite ones, but thanks for the help. I'll study it ASAP.
    Sprites are pretty simple. If it's auto-scrolling, on the exact pixel when it reaches the edge of the screen you set the sprite. This is kinda hard to explain, so I will upload the key to a thing similar to this that I have made. KEY: QDV4338D (credit to GAME4SHOOTER because of the map part of the first section) so yay
    Thanks, random! EDIT: Litterally, I don't know how to use SPDEF.
    SPDEF is pretty simple. It's just making a sprite number (at default, 0 is a strawberry) have a different sprite than normal. Like SPDEF 0,0,0,16,16 makes sprite definition number 0 a strawberry, like it already is. SPDEF 0,0,0,32,32 makes it a 32x32 square instead of 16x16, so you get the strawberry, orange, and 2 other 16x16 things in one sprite. If you did SPDEF 0,16,0,16,16 you would get the orange, since 16,0 is the coordinates on the sprite graphic screen of the orange. The first number is the sprite definition you want to change, 0-4095.
    Posted
  • #16 ✎ 302 the_squat1115 Minecraft Is Awesome! I love Minecraft! Express Yourself Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies
    ~SNIP~ ~SNAP~ Just left the sprite ones, but thanks for the help. I'll study it ASAP.
    Sprites are pretty simple. If it's auto-scrolling, on the exact pixel when it reaches the edge of the screen you set the sprite. This is kinda hard to explain, so I will upload the key to a thing similar to this that I have made. KEY: QDV4338D (credit to GAME4SHOOTER because of the map part of the first section) so yay
    Thanks, random! EDIT: Litterally, I don't know how to use SPDEF.
    SPDEF is pretty simple. It's just making a sprite number (at default, 0 is a strawberry) have a different sprite than normal. Like SPDEF 0,0,0,16,16 makes sprite definition number 0 a strawberry, like it already is. SPDEF 0,0,0,32,32 makes it a 32x32 square instead of 16x16, so you get the strawberry, orange, and 2 other 16x16 things in one sprite. If you did SPDEF 0,16,0,16,16 you would get the orange, since 16,0 is the coordinates on the sprite graphic screen of the orange. The first number is the sprite definition you want to change, 0-4095.
    And the sprites aren't showing for some reason. I don't know how to put them on the map, because there are "H", "F" and other things that I don't see on those DATA commands before the MAP. I just copied the code
    Posted Edited by the_squat1115
  • #17 ✎ 1284 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 Forum Leader Hidden Achievements
    ~SNIP~ ~SNAP~ Just left the sprite ones, but thanks for the help. I'll study it ASAP.
    Sprites are pretty simple. If it's auto-scrolling, on the exact pixel when it reaches the edge of the screen you set the sprite. This is kinda hard to explain, so I will upload the key to a thing similar to this that I have made. KEY: QDV4338D (credit to GAME4SHOOTER because of the map part of the first section) so yay
    Thanks, random! EDIT: Litterally, I don't know how to use SPDEF.
    SPDEF is pretty simple. It's just making a sprite number (at default, 0 is a strawberry) have a different sprite than normal. Like SPDEF 0,0,0,16,16 makes sprite definition number 0 a strawberry, like it already is. SPDEF 0,0,0,32,32 makes it a 32x32 square instead of 16x16, so you get the strawberry, orange, and 2 other 16x16 things in one sprite. If you did SPDEF 0,16,0,16,16 you would get the orange, since 16,0 is the coordinates on the sprite graphic screen of the orange. The first number is the sprite definition you want to change, 0-4095.
    And the sprites aren't showing for some reason. I don't know how to put them on the map, because there are "H", "F" and other things that I don't see on those DATA commands before the MAP. I just copied the code
    If you are talking about an enemy definition table, like BGTABLE, I didn't do that. I just hard-coded that in. Like this: FOR I=0 TO LEN(MAP$)-1 '[insert map display stuff here] IF ASC(MID$(MAP$,I,1))>=ASC("A") THEN SPSET 1,512,SPRITE(MID$(MAP$,I,1)) OUT SP 'Do other stuff here like positioning the sprite and setting variables ENDIF NEXT DEF SPRITE(V1) IF V1-ASC("A")==0 THEN RETURN '[Insert sprite number here] '... END
    Posted Edited by rando
  • #18 ✎ 302 the_squat1115 Minecraft Is Awesome! I love Minecraft! Express Yourself Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies
    ~SNIP~ ~SNAP~ Just left the sprite ones, but thanks for the help. I'll study it ASAP.
    Sprites are pretty simple. If it's auto-scrolling, on the exact pixel when it reaches the edge of the screen you set the sprite. This is kinda hard to explain, so I will upload the key to a thing similar to this that I have made. KEY: QDV4338D (credit to GAME4SHOOTER because of the map part of the first section) so yay
    Thanks, random! EDIT: Litterally, I don't know how to use SPDEF.
    SPDEF is pretty simple. It's just making a sprite number (at default, 0 is a strawberry) have a different sprite than normal. Like SPDEF 0,0,0,16,16 makes sprite definition number 0 a strawberry, like it already is. SPDEF 0,0,0,32,32 makes it a 32x32 square instead of 16x16, so you get the strawberry, orange, and 2 other 16x16 things in one sprite. If you did SPDEF 0,16,0,16,16 you would get the orange, since 16,0 is the coordinates on the sprite graphic screen of the orange. The first number is the sprite definition you want to change, 0-4095.
    And the sprites aren't showing for some reason. I don't know how to put them on the map, because there are "H", "F" and other things that I don't see on those DATA commands before the MAP. I just copied the code
    If you are talking about an enemy definition table, like BGTABLE, I didn't do that. I just hard-coded that in. Like this: FOR I=0 TO LEN(MAP$)-1 '[insert map display stuff here] IF ASC(MID$(MAP$,I,1))>=ASC("A") THEN SPSET 1,512,SPRITE(MID$(MAP$,I,1)) OUT SP 'Do other stuff here like positioning the sprite and setting variables ENDIF NEXT DEF SPRITE(V1) IF V1-ASC("A")==0 THEN RETURN '[Insert sprite number here] '... END
    Thanks again, random_god! EDIT: I tried that, works when I don't put "A","C" or "B" (Enemy SPTABLE definitions), because I only get a Subscript out of range in 0:69. Any way to solve this? If I can on my own, I'm posting how I could solve it. EDIT 2: I could solve it by putting the DEF I made a DEF for the enemy generating...where MAPREAD and MAPRENDER are, but I just get an error saying me: Type mismatch in 0:77(MID$:1). Help? I can solve it on my own anyway, but still need help if someone can.
    Posted Edited by the_squat1115
  • #19 ✎ 1284 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 Forum Leader Hidden Achievements
    ~SHNIP~ Thanks again, random_god! EDIT: I tried that, works when I don't put "A","C" or "B" (Enemy SPTABLE definitions), because I only get a Subscript out of range in 0:69. Any way to solve this? If I can on my own, I'm posting how I could solve it. EDIT 2: I could solve it by putting the DEF I made a DEF for the enemy generating...where MAPREAD and MAPRENDER are, but I just get an error saying me: Type mismatch in 0:77(MID$:1). Help? I can solve it on my own anyway, but still need help if someone can.
    I'm not actually sure what you're doing. If you could send a key, that would help.
    Posted
  • #20 ✎ 302 the_squat1115 Minecraft Is Awesome! I love Minecraft! Express Yourself Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies
    ~SHNIP~ Thanks again, random_god! EDIT: I tried that, works when I don't put "A","C" or "B" (Enemy SPTABLE definitions), because I only get a Subscript out of range in 0:69. Any way to solve this? If I can on my own, I'm posting how I could solve it. EDIT 2: I could solve it by putting the DEF I made a DEF for the enemy generating...where MAPREAD and MAPRENDER are, but I just get an error saying me: Type mismatch in 0:77(MID$:1). Help? I can solve it on my own anyway, but still need help if someone can.
    I'm not actually sure what you're doing. If you could send a key, that would help.
    Ok, then EDIT: Sorry for the long time it took to put the key. I'm writing it. KEY: REMOVED
    Posted Edited by the_squat1115
1 2 3 4