Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Drawing a Tile using SDLx::Sprite

by Muskovitz (Scribe)
on Sep 16, 2017 at 16:54 UTC ( [id://1199522]=perlquestion: print w/replies, xml ) Need Help??

Muskovitz has asked for the wisdom of the Perl Monks concerning the following question:

Hello monks!

i am trying to draw a 2d-tiled map in SDL Perl using the SDLx::Sprite module but i was wondering is this really the proper way to draw a tiled map in SDL Perl? Or there are other ways to do it?
Here is how i draw a tile in Perl SDL

my @tile2=map{ my $sprite = SDLx::Sprite->new( image => 'img/tile/tile2.png', # or surface => SDL::Surfac +e x=>int rand(500)-20, y=>400 ); } 1 .. 50; # .... etc ..... for(@tile2){ $_->draw_xy($app,$_->x,$_->y); }

Perl Monks please guide me.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1199522]
Approved by haukex
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-19 20:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found