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 / Simple code request for my first game , please

Author
Message
Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 20th Jan 2006 03:26 Edited at: 20th Jan 2006 04:10
I`m making a simple 3d pong as my first game (i`m not sure it`s first , but something like that , i havent used Dark Basic for some time now , so it`s preatty same as for it was first...)

Anyways i made a matrix as "floor" in my game , now , i have no idea why , i would like my texture to scroll constantly. I`l make a sea texture or something like that , and i would like it to scroll , that`s all , i would appreciate if someone could write me the script.


edit : Help please ?

my posts have been read or opened
times !
Milkman
19
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 20th Jan 2006 04:17 Edited at: 20th Jan 2006 04:18
from the help files:

Quote: "SCROLL OBJECT TEXTURE
This command will scroll the UV data of the specified object. The UV data controls how a texture is
mapped onto your object. By scrolling the UV data, you can effectively scroll the texture over your object.
The U value controls the horizontal shift of the data. The V value controls the vertical shift of the data.
The scroll effect is permanent.

SYNTAX
SCROLL OBJECT TEXTURE Object Number, X, Y"


EDIT:
just remembered that this is the DB forum; i'm not sure if this command exists in DB

"Genius is 1% inspiration and 99% perspiration"
Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 20th Jan 2006 04:29
Yeah , but i would like to make it to scroll CONSTANTLY , if i just write x and y it will scroll for let`s say 20 pixels if i put so , and i want it to scroll CONSTANTLY , that`s why i aksed so , allright ?

my posts have been read or opened
times !
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 20th Jan 2006 08:10
Loop it.




Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 20th Jan 2006 08:59
It does exist in DB by the way.

Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 20th Jan 2006 14:35 Edited at: 20th Jan 2006 14:35
What you may have to do, is give a variable for the scroll, and change it every frame. (I can't check right now, but I think Scroll is more like 'offset').




This will add one to your scroll amount every frame, and then scroll your texture diagonally (in the X and the Y (or is it U and V)).

I could be wrong, however.
Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 20th Jan 2006 15:40 Edited at: 20th Jan 2006 16:30


my posts have been read or opened
times !
Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 20th Jan 2006 16:53
Anyone , please help ?


I really need my matrix texture to scrool.

my posts have been read or opened
times !
Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 20th Jan 2006 17:33
maybe you can scroll the image manualy
and theny you can update the matrix

[/center]
Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 20th Jan 2006 17:41
Quote: "maybe you can scroll the image manualy"


hm..and how do i do that ?

my posts have been read or opened
times !
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 20th Jan 2006 22:09 Edited at: 20th Jan 2006 22:11
Quote: "It does exist in DB by the way."


This is a shameless plug but that's why I modified the help files so it's easy to see what will work and won't for people with Classic and Enhanced.

http://forum.thegamecreators.com/?m=forum_view&t=69615&b=1

Quote of that same command (the help files are for Pro only):
Quote: "SCROLL OBJECT TEXTURE
( Classic, Enhanced, Pro )

This command will scroll the UV data of the specified object. The UV data controls how a texture is mapped onto your object. By scrolling the UV data, you can effectively scroll the texture over your object. The U value controls the horizontal shift of the data. The V value controls the vertical shift of the data. The scroll effect is permanent.

SYNTAX
SCROLL OBJECT TEXTURE Object Number, X, Y"



Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 25th Jan 2006 09:49
Anyways i need to scrool matrix texture...

my posts have been read or opened
times !
smallg
Valued Member
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 25th Jan 2006 11:23
um pretty sure this is what shift matrix up/down/left/right does....
or u could always use randomize matrix for a sea effect

life's one big game
Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 25th Jan 2006 11:38
Quote: "um pretty sure this is what shift matrix up/down/left/right does....
or u could always use randomize matrix for a sea effect
"


i`l try that shift thing , but i won`t use randomize becouse of my paddles and ball would somethimes find they`r self`s under sea , somethinmes above...

my posts have been read or opened
times !
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 25th Jan 2006 14:08
shift matrix is used for moving the entire height data one grid to that direction. Not scrolling textures.

Scrolling textures is impossible on matrices. You could make a similar effect using multiple images and use them as frames. But this is probably very slow.

If you need a scrolling effect, use objects...

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 25th Jan 2006 15:13
use an object as a matrix make a siliding collision and scroll this texture

[/center]

Login to post a reply

Server time is: 2025-05-22 23:35:38
Your offset time is: 2025-05-22 23:35:38