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 / Shaking Bitmap

Author
Message
Engulfed by Darkness
23
Years of Service
User Offline
Joined: 31st Mar 2003
Location: Canada
Posted: 7th Apr 2003 04:25
Does anyone know how to make full screen bitmap shake up and down for a short period of time.

Thanks for any help.
andrew11
23
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 7th Apr 2003 05:23
Heres a function that will shake the screen. I made it in DBPro, but I dont see why it should not work in DBC.



All programmers are playwrights and all computers are lousy actors." -Anon.
<--- Uh... Um... Oh I forgot
Engulfed by Darkness
23
Years of Service
User Offline
Joined: 31st Mar 2003
Location: Canada
Posted: 7th Apr 2003 07:48
Thanks man that Function works awsome x-d , but i'm havin' some trouble with this code .



When 's' is pushed to go to the Function that shakes the screen and the program returns from the Function it goes to the Start Sub, then the sync rate seems to be different and the program just does'nt work like i want it.

Can someone tell me why this happens ¿

Thanks
Hell IVIonkey
23
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 7th Apr 2003 08:29
Your start sub should be after the game loop. Also, you need a return at the end of the sub.
Engulfed by Darkness
23
Years of Service
User Offline
Joined: 31st Mar 2003
Location: Canada
Posted: 7th Apr 2003 08:54
Ok i have tried that now and it still didn't seem to make a difference :-s
Did it work for U ¿

I have writen programs with Subs before the main game loop in the past and they seem to work fine.

This is starting to make my head hurt !
I need some sleep. :-s
andrew11
23
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 7th Apr 2003 23:32 Edited at: 7th Apr 2003 23:35
You don't have to use Gosub, use Goto. If you use Gosub, you need a return at the end.

Btw: Are you making an echesketch program? I made one in QBasic when I first started programming. It had different color ink, rainbow effects, speed changes, background, etc. Never could get the screen to shake though. It was so cool back then. I think it was the first program I ever made. I'm glad to help you.

http://www34.brinkster.com/andrew11/andrewsketch.htm

All programmers are playwrights and all computers are lousy actors." -Anon.
<--- Uh... Um... Oh I forgot
Engulfed by Darkness
23
Years of Service
User Offline
Joined: 31st Mar 2003
Location: Canada
Posted: 8th Apr 2003 00:46
Ya i'm makin an Etch-a-Sketch program. x-d
I'd thought it would be easy and cool since i'm still quite a newbie to DB.


The code works fine if i remove the shake screen Function but, i don't want to lose the shake screen Function it looks too cool.

I tried using a GoTo instead of a GoSub. Works fine if i cut out the shake screen Function but doesn't work right with it.

I don't get it. ¿¿¿¿ It looks totaly logical to me.

Thanks for tring to help solve this problem man!
andrew11
23
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 8th Apr 2003 02:20
I think I figured it out. You are not deleting the sprite after the function.
Try this:



Hope that works!

All programmers are playwrights and all computers are lousy actors." -Anon.
<--- Uh... Um... Oh I forgot
Engulfed by Darkness
23
Years of Service
User Offline
Joined: 31st Mar 2003
Location: Canada
Posted: 8th Apr 2003 02:29
Cool everything works good now!!!

Ya i don't have any experience with sprites yet but i'am workin on learning it.

Thank for the help!!!
andrew11
23
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 8th Apr 2003 03:58
Well, it is kinda my fault.
Glad to help!

All programmers are playwrights and all computers are lousy actors." -Anon.
<--- Uh... Um... Oh I forgot

Login to post a reply

Server time is: 2026-06-11 15:09:11
Your offset time is: 2026-06-11 15:09:11