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 / how do i do this?

Author
Message
DarkLord5656a
12
Years of Service
User Offline
Joined: 21st Jan 2012
Location: in the underworld
Posted: 22nd Jan 2012 00:59
i cant figure out how to make a sprite i have made to animate for
my 2d game in createtion called super stick fighters
i cant get him to load or move not to mention show

let the darkness privail
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 22nd Jan 2012 12:04
Check up create animated sprite in the documentation for the easy, albeit not very flexible way.
The other approach is to load a set of individual images (or get them as subimages by splitting a sprite sheet image) and then write some functionality for changing the images of a sprite using these. The latter allows for, among other things, varying sizes of each frame, complete frame speed control, etc.


"Why do programmers get Halloween and Christmas mixed up?"
DarkLord5656a
12
Years of Service
User Offline
Joined: 21st Jan 2012
Location: in the underworld
Posted: 22nd Jan 2012 17:51
that didnt help at all srry

let the darkness privail
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 22nd Jan 2012 21:43
Well you need to read the documentation and look at some examples It says quite clearly how to use it.

TheComet

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 22nd Jan 2012 23:08
Post what you have done so that people can help, and do not keep creating new threads at your current rate. You should also be posting questions like this in the Newcomers board.

Chris Tate
DBPro Master
16
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 23rd Jan 2012 02:23
Quote: "i cant figure out how to make a sprite i have made to animate for
my 2d game in createtion called super stick fighters
i cant get him to load or move not to mention show"


Is it?

Darkzombies
13
Years of Service
User Offline
Joined: 25th Dec 2010
Location: In multiple tabs, most likely youtube.
Posted: 23rd Jan 2012 04:38 Edited at: 23rd Jan 2012 04:40
Ok, your only loading them, after loading them then you use them. Use the command:

paste image [image number, x, y]

or:

sprite [sprite number, x, y, image number]

Also, for future reference, press f1 while in darkbasic pro to look at the help file. It helped me alot when I was just starting out.

Oh yeah, and someone direct this guy to the one tutorial guy (-I forgot his name-)

-------------------------------------------------------------
nonZero
13
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 23rd Jan 2012 09:06 Edited at: 23rd Jan 2012 09:06
Quote: "Oh yeah, and someone direct this guy to the one tutorial guy (-I forgot his name-)"

Oh yeah and somebody tell that Begginer's Corner posting guy (-I forgot his name-) that the "tutorial guy's" name is TDK (aka TDK_Man)

Linxor:

http://forum.thegamecreators.com/?m=forum_view&t=99497&b=10

Full list of TDK's tutorials.

@OP
Hint 1: CREATE ANIMATED SPRITE requires that you specify animations in rows and columns meaning it will divide your image up by dividing by those numbers. Hint 2: When looping an animation, the internals handle a large portion of it meaning your should watch your structure when using PLAY SPRITE. Also PLAY SPRITE is called every loop cycle (but only once or you'll get conflicts). You can manually animate it but it's a lot of effort.

Rockstar AP
12
Years of Service
User Offline
Joined: 19th Jan 2012
Location:
Posted: 24th Jan 2012 13:55
hello.....
i just cant seem to produce a fast bullet out of my character(box)...
plz help!!!!!!

here is my code


Rem Project: prac1
Rem Created: 1/23/2012 7:56:57 PM

Rem ***** Main Source File *****
sync on
set window off
hide mouse
autocam off

`set some starting variables
facing# = 0 :`direction camera is looking left and right
pitch# = 0 :`direction camera is looking up and down
camera_distance# = 50 :`how far camera is away from player
camera_height# = 10 :`distance above player camera is pointing at

movement_speed# = 0.5 :`how fast the player moves
turn_multiplier# = 0.1 :`a factor that controls how fast the player turns left and right
pitch_multiplier# = 0.1 :`a factor that controls how fast the player looks up and down
jump_speed# = 0.5 :`initial jump speed


gravity# = 0.003 :`gravity


`make something for the ground and a cube to represent the player
make matrix 1, 1000,1000,10,10



make object cube 1, 10
position object 1, 500,5,500
`main loops
do

`arrow keys to move the player
if upkey() = 1 then move object 1, movement_speed#
if downkey() = 1 then move object 1, movement_speed#*-1
if leftkey() = 1 then move object left 1, movement_speed#
if rightkey() = 1 then move object right 1, movement_speed#

`jump controls
if jump = 0
if controlkey() = 1
`set the velocity in the y direction to the initial jump speed
y_vel# = jump_speed#
jump = 1
endif
endif

`calculate vertical velocity and move object in the y axis
y_vel# = y_vel# - gravity#
move object up 1, y_vel#

`check to see if the object has hit the ground
if object position y(1) < 5
`stop the object from falling
position object 1, object position x(1), 5, object position z(1)
`set velocity in the y direction to zero
y_vel# = 0
jump = 0
endif

`mouse to look left, right and up, down
move_mouse_x# = mousemovex() :`write mouse move to variable
move_mouse_y# = mousemovey() :`write mouse move to variable

`calculate the direction the player and camera is facing
facing# = wrapvalue(facing# + move_mouse_x#*turn_multiplier#) :`left and right
pitch# = wrapvalue(pitch# + move_mouse_y#*pitch_multiplier#) :`up and down

`restrict up and down movement camera pitch
campitchtest# = wrapvalue(pitch#+180)
if campitchtest# < 90 then pitch# = 270
if campitchtest# > 270 then pitch# = 90


`rotate the cube (player) to the new facing left and right
yrotate object 1, facing#


`this is the first method for camera control
set camera to follow object position x(1), object position y(1), object position z(1), facing#, camera_distance#, camera_height#, 10,0
`this line lets the player look up down
xrotate camera pitch#


set cursor 0,0
print "use arrow keys to move, mouse to look and control to jump"

print
center text screen width()/2,screen height()/2,"+"

sync

loop

A.P
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 24th Jan 2012 17:48
Rockstar, you need to create your own thread to ask this question. As you have provided your code, you are likely to get some answers once people can see your question.

Darkzombies
13
Years of Service
User Offline
Joined: 25th Dec 2010
Location: In multiple tabs, most likely youtube.
Posted: 25th Jan 2012 07:43
Yeah rockstar, keep to one thread, you'll get your answer, maybe you should read the rules, or go to some of TDK's tutorials.

-------------------------------------------------------------

Login to post a reply

Server time is: 2024-11-22 05:56:44
Your offset time is: 2024-11-22 05:56:44