Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Functions are getting annoying...

Author
Message
elVee
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location:
Posted: 11th Oct 2003 06:22

Im making a space invaders style of game (atleast I think I am ) and somethings wrong. right now, the player can shoot, but the lasers and bombs dont go anywhere
the game calls a function primaryfire() (or secondaryfire() if its a bomb) when the player clicks, to place the sprites. The problem is it justs puts them there and they dont do anything.
after each game loop, the program calls a subroutine updatescr, which is SUPPOSED to reposition the laser sprites.

can someone tell me whats wrong?
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 11th Oct 2003 10:26
Ok, im not too sure, but i believe its because your placing the sprite in the same position as it already was...

by doing:



You're just positioning it in the same place as i already was...

To fix it, you need to do something like:



Dont know if it'll work though...

Hope I Helped...

Knowladge Belongs To The People...
elVee
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location:
Posted: 11th Oct 2003 11:23
I tried that.... It didnt work so I tried putting the sprite x(50) and sprite y(50) into oldx and oldy....

The y part is in a different spot....
i have:
oldy-las(1)
for the y positioning, which is the old y location minus 14 or something.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 11th Oct 2003 16:08
Hmmm, ok... well, im not sure then, sorry...

Knowladge Belongs To The People...
elVee
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location:
Posted: 12th Oct 2003 00:18
Ahhh I figured it out!!! Its because some of the variables arent globals... I hate the way dbc cant use globals without arrays.
I just replaced the functions with subs and it works

Login to post a reply

Server time is: 2025-05-20 17:49:37
Your offset time is: 2025-05-20 17:49:37