Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Using Sprites in turing 4.0.x
Index -> Programming, Turing -> Turing Tutorials
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Dan




PostPosted: Sat Mar 06, 2004 3:42 pm   Post subject: Using Sprites in turing 4.0.x

Check out this thing i made here:

http://www.compsci.ca/mx/index.php?page=58


you may need to know how to import unit files to get it working. If you guys rember what Sprites where u may find this cool. For thous who do not, they are like pics but when u move them they dont deleleat the backgorup so it makes animation easer and better b/c you dont have to redraw the back gorund every few seconds.

I got a doc on there on how to uses them to so that may help explaine it a bit.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Sat Mar 06, 2004 7:05 pm   Post subject: (No subject)

Another EX code:

code:

import "DanSprite.tu"

setscreen ("graphics:max;max,nobuttonbar")
setscreen ("offscreenonly")


for i : 1 .. maxx by 5
    Draw.Line (i, 0, i, maxy, 3)
end for

for ii : 1 .. maxy by 5
    Draw.Line (maxx, ii, 0, ii, 4)
end for

for iii : 1 .. maxcolor
    Draw.FillOval (maxx div 2, maxy div 2, maxcolor - iii, maxcolor - iii, iii)
end for


procedure flush
    var ch : string (1)
    loop
        exit when not hasch
        getch (ch)
    end loop
end flush


var chars : array char of boolean
var x, y := 1

var pic : int := DanSprite.newPic (1, 1, "pic.jpg")
DanSprite.setMode(pic,DanSprite.MERGE)

loop
    if Input.hasch then
        Input.KeyDown (chars)
        if chars (KEY_UP_ARROW) then
            y += 10
        end if
        if chars (KEY_RIGHT_ARROW) then
            x += 10
        end if
        if chars (KEY_LEFT_ARROW) then
            x -= 10
        end if
        if chars (KEY_DOWN_ARROW) then
            y -= 10
        end if
        DanSprite.movePic (x, y, pic)
        View.Update
        flush ()
    end if

end loop
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
recneps




PostPosted: Sat Mar 06, 2004 8:49 pm   Post subject: (No subject)

Nice Dan, you should submit that to Holtsoft! haha. If you werent admin/mod id give you ALL ME BITS! Very Happy
Omicron91




PostPosted: Mon Dec 20, 2004 5:55 pm   Post subject: (No subject)

Dan, can I have your children? Well, technically not, but if I were a woman I'd be all over you. DanSprite saved my RPG Very Happy!
Bacchus




PostPosted: Sun Feb 06, 2005 12:54 am   Post subject: (No subject)

nice work, but i found a bug easy to fix thoug. in chagePic (i love the name too Razz) it has an error, you just forgot to put in the picture id (only inputs the number
code:
procedure chagePic (x : int, y : int, fileName : string, picID : int)
        assert picID > 0 and picID <= num     %if u get error: bad pic id
        Pic.Draw (temp (picID), oldx (picID), oldy (picID), picCopy)

        Pic.Free (pic(picID))  %<-- was originally just Pic.Free(picID)
blaster0




PostPosted: Sun Jun 26, 2005 10:07 pm   Post subject: Sprites

I'm sorry for sounding so ignorant but is there a away to very easily using commands such as sprite.new and sprite.animate make a working sprite. And if so can you explain my turing help isn't doing to much for me.
Cervantes




PostPosted: Mon Jun 27, 2005 7:44 am   Post subject: (No subject)

The sprite commands in Turing 4.x have been disabled. Are you asking for help as to how to use them, or how to use DanSprite? Also, Bacchus made a BacchusSprite that you may wish to check out as well.
Spartan_117




PostPosted: Tue Jul 19, 2005 11:32 am   Post subject: (No subject)

Arent sprites moving images? like for example a walking mario? those are gifs tho, how do u import thos when Turing doesnt allow that.
MysticVegeta




PostPosted: Tue Jul 19, 2005 12:21 pm   Post subject: (No subject)

why do you think he made it then lol Laughing
Spartan_117




PostPosted: Tue Jul 19, 2005 5:37 pm   Post subject: (No subject)

but in his example we only import one picture.... i kinda forgot turing so maybe im missing something,
[Gandalf]




PostPosted: Tue Jul 19, 2005 6:16 pm   Post subject: (No subject)

Yes, but the point is that he takes that picture and animate it using Turing. A .gif is already pre-animated, and you need some program to edit it. Using this you can animate it however you want in Turing, and use it in either a game or animation or whatever you can think of.
Delos




PostPosted: Tue Jul 19, 2005 8:06 pm   Post subject: (No subject)

Generally speaking, .gifs are indeed a series of single-frame pictures put together in a format that displays them alternatively with a certain, set delay between each picture. For instance, my avatar is actually a large picture spliced up and turned into a .gif using 3 frames.
Hence, having only one picture imported by the module is not a problem, as you would be able to import a series of such pictures, string them together, and voilà, you have your animation.
MysticVegeta




PostPosted: Wed Jul 20, 2005 8:38 am   Post subject: (No subject)

Make it play 35 fps and you have tv speed animation lol
The Unknown




PostPosted: Sat Dec 17, 2005 9:00 pm   Post subject: (No subject)

Um, I can't check out the initial link. This error message pops up:

General Error

Could not query modules information

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mod WHERE blk.function_id = fnc.function_id AND blk.block_id = bct.' at line 5

SELECT blk.block_id, bct.column_id, module_path, function_file, auth_view FROM mx_column_block bct, mx_block blk, mx_function fnc, mx_module mod WHERE blk.function_id = fnc.function_id AND blk.block_id = bct.block_id AND fnc.module_id = mod.module_id ORDER BY column_id, block_order

Line : 103
File : /home/.angela/hackerdan/compsci.ca/mx/index.php


can anyone help me here (keep in mind that I do not know what the hell that message is saying Crying or Very sad )?
[Gandalf]




PostPosted: Sat Dec 17, 2005 9:03 pm   Post subject: (No subject)

The link is broken because of the change in hosts of compsci, but not everything is still hosted...

You can find a different, probably better version made by Bacchus here:
http://www.compsci.ca/v2/viewtopic.php?t=8108
Display posts from previous:   
   Index -> Programming, Turing -> Turing Tutorials
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 16 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: