Code: Select all
solved
Please assist.[COMPILER]Line 17:LoadVariables() is not a function, an array, or linked list.
Sincerely,
Dark Mars Software

Code: Select all
solved
Please assist.[COMPILER]Line 17:LoadVariables() is not a function, an array, or linked list.

The code its referencing:[ERROR]Invalid Memory Access.
Code: Select all
solved

Code: Select all
solved
Code: Select all
solved
Code: Select all
solved
And references this code:#Sprite Object not initalized
Code: Select all
solved
Code: Select all
solved
Code: Select all
solved


Code: Select all
Procedure LoadSprites()
LoadSprite(0, "Sprite\bat.bmp", 0)
If IsSprite(0) = 0
MessageRequester("Error", "Can't open Sprite\bat.bmp", 0)
EndIf
player_1_position = 320
CopySprite(0, 1, 0)
player_2_position = 320
LoadSprite(2, "Sprite\ball.bmp", 0)
If IsSprite(2) = 0
MessageRequester("Error", "Can't open Sprite\ball.bmp", 0)
EndIf
ball_x_position = 320
ball_y_position = 240
EndProcedure
Procedure LoadVariables()
;initalize player 1's variables
Global player_1_position.w
Global player_1_score.w
;initalize player 1's variables
Global player_2_position.w
Global player_2_score.w
;initalize ball's variables
Global ball_x_position.w
Global ball_y_position.w
EndProcedure
Procedure Player1Movement()
;check for keyboard input
ExamineKeyboard()
;if player 1 presses left
If KeyboardPushed(#PB_Key_Left)
player_1_position - 5
EndIf
;if player 1 presses right
If KeyboardPushed(#PB_Key_Right)
player_1_position + 5
EndIf
PositionObjects()
EndProcedure
Procedure Player2Movement()
;check for keyboard input
ExamineKeyboard()
;if player 2 presses left
If KeyboardPushed(#PB_Key_A)
player_2_position - 5
EndIf
;if player 2 presses right
If KeyboardPushed(#PB_Key_S)
player_2_position + 5
EndIf
PositionObjects()
EndProcedure
Procedure PositionObjects()
ClearScreen(0, 0, 0)
DisplaySprite(0, player_1_position, 15)
DisplaySprite(1, player_2_position, 450)
DisplaySprite(2, ball_x_position, ball_y_position)
EndProcedure
;ExecutableFormat=Windows
;Executable=C:\Projects\Pong Master - Pure BASIC\Pong Master.exe
;EOF


This is called in the game loop.netmaestro wrote:I see a bunch of procedures there, but I don't see where you're calling them. Is this all the code? I wouldn't expect this to do anything. Also, the variables used to store the sprite positions in shouldn't be type .word, they should be type .long
Code: Select all
Repeat
Procedure1()
Procedure2()
Procedure3()
...
Until KeyboardPushed(#PB_Key_Escape)

Code: Select all
solved



Code: Select all
solved