LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

Spooky Scary Programming Contest 2018

Root / Site Discussion / [.]

🔒
haloopdyCreated:
The rest of my game should be pretty easy from here, I finished world generation/loading.
Have you finished saving yet?
Yes. My player sprites are based off of swan's sprites for Celestrium. My world generator generates worlds in about a minute, and the game can properly load maps. You can see the ice biome in my profile picture.
Oh cool! Also, you based your sprites off Celestrium’s which were in turn based off Terraria’s sprites? Okay.
Yep. Everything works well now. I will submit it after I add the inventory menus and the ability to use some items.

I assume that SIM.3D is ok, to use right? (http://smilebasicsource.com/page?pid=1053 Key = HEAEP3). I have been playing with that one a little bit. What about code you find and port over from the internet. Something like say https://www.youtube.com/watch?v=Y37-gB83HKE Javidx9's maze generation algorithm for example? Good? Bad? By the way, if anyone is interested, the code I ported over and a screen shot is right below. Anyone else a fan?
OPTION STRICT
VAR SCREEN_W = 400
VAR SCREEN_H = 240
VAR CONSOLE_W = 200 'DIFFERENT NUMBERS FOR
VAR CONSOLE_H = 120 'INTEGER CHARACTER SIZE
VAR CHAR_W = SCREEN_W / CONSOLE_W
VAR CHAR_H = SCREEN_H / CONSOLE_H

VAR MAZE_W, MAZE_H, MAZE[0], VISITED_CELLS
VAR CELL_PATH_N = &H01
VAR CELL_PATH_E = &H02
VAR CELL_PATH_S = &H04
VAR CELL_PATH_W = &H08
VAR CELL_VISITED = &H10 '16

VAR PATH_W = 3

'UNLIKE THE VIDEO I WILL JUST PUSH
'TWO ENTRIES PER XY PAIR. JUST NEED TO
'REMEMBER TO POP AND PUSH IN REVERSE ORDER
'PUSH X,Y THEN POP Y,X
VAR STACK[0]

'Maze algorithm adapted from the video
'"Programming Mazes" by javidx9 on Youtube
'https://www.youtube.com/watch?v=Y37-gB83HKE
'
MAIN

END

DEF MAIN
 VAR B, GAME_OVER = FALSE, T1, T2, DT
 VAR PAGE_DRAW = 0, PAGE_SHOW = 1
 ACLS
 GPAGE PAGE_SHOW, PAGE_DRAW
 ON_USER_CREATE
 T2 = MILLISEC - 16
 WHILE !GAME_OVER
  T1 = T2
  T2 = MILLISEC
  DT = T2 - T1
  B = BUTTON()
  ON_USER_UPDATE DT, B
  IF (B AND #X) != 0 THEN GAME_OVER = TRUE
  SWAP PAGE_SHOW, PAGE_DRAW
  GPAGE PAGE_SHOW, PAGE_DRAW
  'VSYNC
 WEND
END

DEF ON_USER_CREATE
 VAR I
 
 MAZE_W = 50
 MAZE_H = 30
 
 'Allocate maze
 'Remove if too many
 WHILE LEN(MAZE) > (MAZE_W * MAZE_H)
  I = POP(MAZE)
 WEND
 
 'Add if too small
 WHILE LEN(MAZE) < (MAZE_W * MAZE_H)
  PUSH MAZE, 0
 WEND
 
 'Now zero everything out
 FOR I = 0 TO (MAZE_W * MAZE_H) - 1
  MAZE[I] = 0
 NEXT I
 
 'Clear out the stack
 WHILE LEN(STACK) > 0
  I = POP(STACK)
 WEND
 
 'Add the starting position
 PUSH STACK, 0 'Start at 0, 0
 PUSH STACK, 0
 'Mark it visited
 MAZE[0] = CELL_VISITED
 VISITED_CELLS = 1
 
END

DEF ON_USER_UPDATE DT, B
 VAR I, J, PX, PY, X, Y, CLR
 VAR NEIGHBORS[0]
 VAR NORTH = 1
 VAR EAST = 2
 VAR SOUTH = 3
 VAR WEST = 4
 VAR NEXT_DIR
 'Do Maze Algorithm
 
 IF VISITED_CELLS < (MAZE_W * MAZE_H) THEN
  'Peek top of stack for current x, y
  Y = STACK[LEN(STACK) - 1]
  X = STACK[LEN(STACK) - 2]
  
  'Step 1: Create a set of unvisited neighbors
  '
  'North neighbor
  IF Y > 0 THEN
   IF (MAZE[((Y - 1) * MAZE_W) + X] AND CELL_VISITED) == 0 THEN
    PUSH NEIGHBORS, NORTH
   ENDIF
  ENDIF
  
  'East neighbor
  IF X < MAZE_W - 1 THEN
   IF (MAZE[(Y * MAZE_W) + X + 1] AND CELL_VISITED) == 0 THEN
    PUSH NEIGHBORS, EAST
   ENDIF
  ENDIF
  
  
  'South neighbor
  IF Y < MAZE_H - 1 THEN
   IF (MAZE[((Y + 1) * MAZE_W) + X] AND CELL_VISITED) == 0 THEN
    PUSH NEIGHBORS, SOUTH
   ENDIF
  ENDIF
  
  
  'West neighbor
  IF X > 0 THEN
   IF (MAZE[(Y * MAZE_W) + X - 1] AND CELL_VISITED) == 0 THEN
    PUSH NEIGHBORS, WEST
   ENDIF
  ENDIF
  
  IF LEN(NEIGHBORS) > 0 THEN
   'Choose one available neighbor at random
   NEXT_DIR = NEIGHBORS[RND(LEN(NEIGHBORS))]
   
   'Create a path between the neighbor and 
   'the current cell
   IF NEXT_DIR == NORTH THEN
    MAZE[Y * MAZE_W + X] = (MAZE[Y * MAZE_W + X] OR CELL_PATH_N)
    MAZE[(Y - 1) * MAZE_W + X] = (MAZE[(Y - 1) * MAZE_W + X] OR CELL_PATH_S)
    PUSH STACK, X
    PUSH STACK, Y - 1
   ELSEIF NEXT_DIR == EAST THEN
    MAZE[Y * MAZE_W + X] = (MAZE[Y * MAZE_W + X] OR CELL_PATH_E)
    MAZE[Y * MAZE_W + X + 1] = (MAZE[Y * MAZE_W + X + 1] OR CELL_PATH_W)
    PUSH STACK, X + 1
    PUSH STACK, Y
   ELSEIF NEXT_DIR == SOUTH THEN
    MAZE[Y * MAZE_W + X] = (MAZE[Y * MAZE_W + X] OR CELL_PATH_S)
    MAZE[(Y + 1) * MAZE_W + X] = (MAZE[(Y + 1) * MAZE_W + X] OR CELL_PATH_N)
    PUSH STACK, X
    PUSH STACK, Y + 1
   ELSEIF NEXT_DIR == WEST THEN
    MAZE[Y * MAZE_W + X] = (MAZE[Y * MAZE_W + X] OR CELL_PATH_W)
    MAZE[Y * MAZE_W + X - 1] = (MAZE[Y * MAZE_W + X - 1] OR CELL_PATH_E)
    PUSH STACK, X - 1
    PUSH STACK, Y
   ELSE
   ENDIF
   
   'New cell
   'Mark new cell visited and increase count
   'Peek top of stack for current x, y
   Y = STACK[LEN(STACK) - 1]
   X = STACK[LEN(STACK) - 2]
   
   'Mark it visited
   MAZE[Y * MAZE_W + X] = (MAZE[Y * MAZE_W + X] OR CELL_VISITED)
   VISITED_CELLS = VISITED_CELLS + 1
  ELSE
   Y = POP(STACK)
   X = POP(STACK)
  ENDIF
  
 ENDIF
 
 'IF VISITED_CELLS < MAZE_W * MAZE_H THEN RETURN
 GCLS
 FOR J = 0 TO MAZE_H - 1
  FOR I = 0 TO MAZE_W - 1
   IF MAZE[J * MAZE_W + I] AND CELL_VISITED THEN
    CLR = #WHITE
   ELSE
    CLR = #BLUE
   ENDIF
   
   IF I == X && J == Y AND VISITED_CELLS < MAZE_W * MAZE_H THEN 
    CLR = #LIME
   ENDIF

   DRAW_CELL I * (PATH_W + 1), J * (PATH_W + 1), CLR
   'South wall
   IF (MAZE[J * MAZE_W + I] AND CELL_PATH_S) != 0 THEN
    CLR = #WHITE
   ELSE
    CLR = #BLACK
   ENDIF
   
   FOR PX = 0 TO PATH_W - 1
    DRAW_PIXEL I * (PATH_W + 1) + PX, J * (PATH_W + 1) + PATH_W, CLR
   NEXT PX
   
   'East wall
   IF (MAZE[J * MAZE_W + I] AND CELL_PATH_E) != 0 THEN
    CLR = #WHITE
   ELSE
    CLR = #BLACK
   ENDIF
   
   FOR PY = 0 TO PATH_W - 1
    DRAW_PIXEL I * (PATH_W + 1) + PATH_W, J * (PATH_W + 1) + PY, CLR
   NEXT PX
  NEXT I
 NEXT J
 
END

DEF DRAW_PIXEL X, Y, CLR
 GFILL X * CHAR_W, Y * CHAR_H, (X + 1) * CHAR_W - 1, (Y + 1) * CHAR_H - 1, CLR
END

DEF DRAW_CELL X, Y, CLR
 GFILL X * CHAR_W, Y * CHAR_H, (X + 1 + PATH_W) * CHAR_W - CHAR_W - 1, (Y + 1 + PATH_W) * CHAR_H - CHAR_H - 1, CLR
END


I know for sure Sim.3D is fine, but I don’t know about the other stuff

I assume that SIM.3D is ok, to use right? (http://smilebasicsource.com/page?pid=1053 Key = HEAEP3). I have been playing with that one a little bit. What about code you find and port over from the internet. Something like say https://www.youtube.com/watch?v=Y37-gB83HKE Javidx9's maze generation algorithm for example? Good? Bad? By the way, if anyone is interested, the code I ported over and a screen shot is right below. Anyone else a fan?
Content
OPTION STRICT
VAR SCREEN_W = 400
VAR SCREEN_H = 240
VAR CONSOLE_W = 200 'DIFFERENT NUMBERS FOR
VAR CONSOLE_H = 120 'INTEGER CHARACTER SIZE
VAR CHAR_W = SCREEN_W / CONSOLE_W
VAR CHAR_H = SCREEN_H / CONSOLE_H

VAR MAZE_W, MAZE_H, MAZE[0], VISITED_CELLS
VAR CELL_PATH_N = &H01
VAR CELL_PATH_E = &H02
VAR CELL_PATH_S = &H04
VAR CELL_PATH_W = &H08
VAR CELL_VISITED = &H10 '16

VAR PATH_W = 3

'UNLIKE THE VIDEO I WILL JUST PUSH
'TWO ENTRIES PER XY PAIR. JUST NEED TO
'REMEMBER TO POP AND PUSH IN REVERSE ORDER
'PUSH X,Y THEN POP Y,X
VAR STACK[0]

'Maze algorithm adapted from the video
'"Programming Mazes" by javidx9 on Youtube
'https://www.youtube.com/watch?v=Y37-gB83HKE
'
MAIN

END

DEF MAIN
 VAR B, GAME_OVER = FALSE, T1, T2, DT
 VAR PAGE_DRAW = 0, PAGE_SHOW = 1
 ACLS
 GPAGE PAGE_SHOW, PAGE_DRAW
 ON_USER_CREATE
 T2 = MILLISEC - 16
 WHILE !GAME_OVER
  T1 = T2
  T2 = MILLISEC
  DT = T2 - T1
  B = BUTTON()
  ON_USER_UPDATE DT, B
  IF (B AND #X) != 0 THEN GAME_OVER = TRUE
  SWAP PAGE_SHOW, PAGE_DRAW
  GPAGE PAGE_SHOW, PAGE_DRAW
  'VSYNC
 WEND
END

DEF ON_USER_CREATE
 VAR I
 
 MAZE_W = 50
 MAZE_H = 30
 
 'Allocate maze
 'Remove if too many
 WHILE LEN(MAZE) > (MAZE_W * MAZE_H)
  I = POP(MAZE)
 WEND
 
 'Add if too small
 WHILE LEN(MAZE) < (MAZE_W * MAZE_H)
  PUSH MAZE, 0
 WEND
 
 'Now zero everything out
 FOR I = 0 TO (MAZE_W * MAZE_H) - 1
  MAZE[I] = 0
 NEXT I
 
 'Clear out the stack
 WHILE LEN(STACK) > 0
  I = POP(STACK)
 WEND
 
 'Add the starting position
 PUSH STACK, 0 'Start at 0, 0
 PUSH STACK, 0
 'Mark it visited
 MAZE[0] = CELL_VISITED
 VISITED_CELLS = 1
 
END

DEF ON_USER_UPDATE DT, B
 VAR I, J, PX, PY, X, Y, CLR
 VAR NEIGHBORS[0]
 VAR NORTH = 1
 VAR EAST = 2
 VAR SOUTH = 3
 VAR WEST = 4
 VAR NEXT_DIR
 'Do Maze Algorithm
 
 IF VISITED_CELLS < (MAZE_W * MAZE_H) THEN
  'Peek top of stack for current x, y
  Y = STACK[LEN(STACK) - 1]
  X = STACK[LEN(STACK) - 2]
  
  'Step 1: Create a set of unvisited neighbors
  '
  'North neighbor
  IF Y > 0 THEN
   IF (MAZE[((Y - 1) * MAZE_W) + X] AND CELL_VISITED) == 0 THEN
    PUSH NEIGHBORS, NORTH
   ENDIF
  ENDIF
  
  'East neighbor
  IF X < MAZE_W - 1 THEN
   IF (MAZE[(Y * MAZE_W) + X + 1] AND CELL_VISITED) == 0 THEN
    PUSH NEIGHBORS, EAST
   ENDIF
  ENDIF
  
  
  'South neighbor
  IF Y < MAZE_H - 1 THEN
   IF (MAZE[((Y + 1) * MAZE_W) + X] AND CELL_VISITED) == 0 THEN
    PUSH NEIGHBORS, SOUTH
   ENDIF
  ENDIF
  
  
  'West neighbor
  IF X > 0 THEN
   IF (MAZE[(Y * MAZE_W) + X - 1] AND CELL_VISITED) == 0 THEN
    PUSH NEIGHBORS, WEST
   ENDIF
  ENDIF
  
  IF LEN(NEIGHBORS) > 0 THEN
   'Choose one available neighbor at random
   NEXT_DIR = NEIGHBORS[RND(LEN(NEIGHBORS))]
   
   'Create a path between the neighbor and 
   'the current cell
   IF NEXT_DIR == NORTH THEN
    MAZE[Y * MAZE_W + X] = (MAZE[Y * MAZE_W + X] OR CELL_PATH_N)
    MAZE[(Y - 1) * MAZE_W + X] = (MAZE[(Y - 1) * MAZE_W + X] OR CELL_PATH_S)
    PUSH STACK, X
    PUSH STACK, Y - 1
   ELSEIF NEXT_DIR == EAST THEN
    MAZE[Y * MAZE_W + X] = (MAZE[Y * MAZE_W + X] OR CELL_PATH_E)
    MAZE[Y * MAZE_W + X + 1] = (MAZE[Y * MAZE_W + X + 1] OR CELL_PATH_W)
    PUSH STACK, X + 1
    PUSH STACK, Y
   ELSEIF NEXT_DIR == SOUTH THEN
    MAZE[Y * MAZE_W + X] = (MAZE[Y * MAZE_W + X] OR CELL_PATH_S)
    MAZE[(Y + 1) * MAZE_W + X] = (MAZE[(Y + 1) * MAZE_W + X] OR CELL_PATH_N)
    PUSH STACK, X
    PUSH STACK, Y + 1
   ELSEIF NEXT_DIR == WEST THEN
    MAZE[Y * MAZE_W + X] = (MAZE[Y * MAZE_W + X] OR CELL_PATH_W)
    MAZE[Y * MAZE_W + X - 1] = (MAZE[Y * MAZE_W + X - 1] OR CELL_PATH_E)
    PUSH STACK, X - 1
    PUSH STACK, Y
   ELSE
   ENDIF
   
   'New cell
   'Mark new cell visited and increase count
   'Peek top of stack for current x, y
   Y = STACK[LEN(STACK) - 1]
   X = STACK[LEN(STACK) - 2]
   
   'Mark it visited
   MAZE[Y * MAZE_W + X] = (MAZE[Y * MAZE_W + X] OR CELL_VISITED)
   VISITED_CELLS = VISITED_CELLS + 1
  ELSE
   Y = POP(STACK)
   X = POP(STACK)
  ENDIF
  
 ENDIF
 
 'IF VISITED_CELLS < MAZE_W * MAZE_H THEN RETURN
 GCLS
 FOR J = 0 TO MAZE_H - 1
  FOR I = 0 TO MAZE_W - 1
   IF MAZE[J * MAZE_W + I] AND CELL_VISITED THEN
    CLR = #WHITE
   ELSE
    CLR = #BLUE
   ENDIF
   
   IF I == X && J == Y AND VISITED_CELLS < MAZE_W * MAZE_H THEN 
    CLR = #LIME
   ENDIF

   DRAW_CELL I * (PATH_W + 1), J * (PATH_W + 1), CLR
   'South wall
   IF (MAZE[J * MAZE_W + I] AND CELL_PATH_S) != 0 THEN
    CLR = #WHITE
   ELSE
    CLR = #BLACK
   ENDIF
   
   FOR PX = 0 TO PATH_W - 1
    DRAW_PIXEL I * (PATH_W + 1) + PX, J * (PATH_W + 1) + PATH_W, CLR
   NEXT PX
   
   'East wall
   IF (MAZE[J * MAZE_W + I] AND CELL_PATH_E) != 0 THEN
    CLR = #WHITE
   ELSE
    CLR = #BLACK
   ENDIF
   
   FOR PY = 0 TO PATH_W - 1
    DRAW_PIXEL I * (PATH_W + 1) + PATH_W, J * (PATH_W + 1) + PY, CLR
   NEXT PX
  NEXT I
 NEXT J
 
END

DEF DRAW_PIXEL X, Y, CLR
 GFILL X * CHAR_W, Y * CHAR_H, (X + 1) * CHAR_W - 1, (Y + 1) * CHAR_H - 1, CLR
END

DEF DRAW_CELL X, Y, CLR
 GFILL X * CHAR_W, Y * CHAR_H, (X + 1 + PATH_W) * CHAR_W - CHAR_W - 1, (Y + 1 + PATH_W) * CHAR_H - CHAR_H - 1, CLR
END

I know for sure Sim.3D is fine, but I don’t know about the other stuff
They should both be fine since they've been posted online for others to use

SIM.3D is fine, porting is more or less "original code" so you're fine.

If I really wanted to, I could give you 240 spaces. EDIT: I just decided to make XL worlds available for all 3DS systems. *half of SBS cheers*

I just decided to make XL worlds available for all 3DS systems.
Wait, so were you trying to make 3DS XL-exclusive worlds for your game or something? They both have the same screen resolution, so all programs look and perform the same between the two systems. You can try making New 3DS-exclsuive levels by using the HARDWARE variable (0 on 3DS, 1 on New 3DS), although there's really no point to it.

I just decided to make XL worlds available for all 3DS systems.
Wait, so were you trying to make 3DS XL-exclusive worlds for your game or something? They both have the same screen resolution, so all programs look and perform the same between the two systems. You can try making New 3DS-exclsuive levels by using the HARDWARE variable (0 on 3DS, 1 on New 3DS), although there's really no point to it.
I know. That's why I made it not n3DS exclusive. Also, the game has awesome music, thanks to RWIIUG0129.

Unfortunately, my project may not be completed on time. I spent too much of my time trying to get a 2D camera working that I forgot to add... the game. Also, I have something more important that I need to work on: my grades. Sorry, and good luck to everyone else

Unfortunately, my project may not be completed on time. I spent too much of my time trying to get a 2D camera working that I forgot to add... the game. Also, I have something more important that I need to work on: my grades. Sorry, and good luck to everyone else
Cool. Good luck!

Sorry, looks like I won't have time to work on anything this week. I wanted to make something, but I am pretty much already out of free time until next week.

Sorry, looks like I won't have time to work on anything this week. I wanted to make something, but I am pretty much already out of free time until next week.
Ah... guess there won't be much entries :'(

I may not be able to participate this time...

^

I may not be able to participate this time...
Can’t say I’m surprised, with that sonic game concept. That’s just too much of a game for SB.
^
Can’t say I’m surprised

If I had started later and my motivation for completely coding an emulator stayed this month I'd have a 16 fake computer running an operating system uploaded as my entry but oh well

My game is looking sparkly and fresh and doesn't in any way look crusty. Please note that you shouldn't jump off of the side of worlds. We call that suicide.

Why did the week i was going to actually implement the game part of my game since i finished the main mechanic of it have to be the week where i literally have 4 or 5 school projects due ahhhG

Why did the week i was going to actually implement the game part of my game since i finished the main mechanic of it have to be the week where i literally have 4 or 5 school projects due ahhhG
Just do them before that week. Or is that this week? (duh) Or were they assigned the same week? I have to write a 7 page legal brief for history, but that's not due until December.

What would happen if there were only 3 or 4 entries, or even just 2? There’s not looking to be very many by the 27th.