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.

Newcomers DBPro Corner / My fist Program but still having Problems

Author
Message
Ian Hughes
20
Years of Service
User Offline
Joined: 29th Sep 2003
Location: UK
Posted: 13th Oct 2003 16:45 Edited at: 13th Oct 2003 16:47
Hello Agian
OK I have mange to get a space invader graphic andi have manag to move him to the left or right ut here my problem.

when my invader reaches the end of the screen i can not work out how to drop the invader down one line and them move him the opposite direction ? also my invader flases when he moves is this because of the loop in the program if so how do you stop the lashing?

cheers
Ian


`load your image first
load image "invader.bmp",1
letterX=300
letterY=200

do
cls


if letterX>0 then letterX=letterX-10
if letterX=0 then letterX=letterX+10
`if letterY>0 then letterY=letterY-1
`if letterY<0 then letterY=letterY+1
paste image 1, letterX, letterY
loop

Spam UK
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 13th Oct 2003 19:12
I made a space invaders mock-up game using only primitives, you can have the code if you like, the only thing I didn't do was make the inavders "walk" back and forth, and down. In thinking about this I figured I'd use a couple of hidden objects that denote the outter point (width) of the group of invaders, checking for when they reach a certain horizontal position to cause the invaders to drop down 1 level...of course I never finished or implemented it, but the game is fully functional otherwise

-RUST-
Pazza
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location: United Kingdom
Posted: 13th Oct 2003 19:20
to stop the invader flashing when it moves, try putting sync on at the top of the source and then just before loop try sync

e.g

`load your image first
load image "invader.bmp",1
letterX=300
letterY=200
sync on
do
cls


if letterX>0 then letterX=letterX-10
if letterX=0 then letterX=letterX+10
`if letterY>0 then letterY=letterY-1
`if letterY<0 then letterY=letterY+1
paste image 1, letterX, letterY
sync
loop

"Bite my shiny metal ass!" - Bender
Pazza
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location: United Kingdom
Posted: 13th Oct 2003 19:33
i played about a bit with your code, i think i achieved what you wanted?

"Bite my shiny metal ass!" - Bender

Login to post a reply

Server time is: 2024-09-21 03:51:03
Your offset time is: 2024-09-21 03:51:03