Register    Login    Forum    Search    FAQ

Board index » Everything




Post new topic Reply to topic  [ 49 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post Posted: January 13th, 2017, 6:07 am 
 

Joined: January 12th, 2017, 12:28 am
Posts: 18
Hey I'm curious as to how you managed to crop the exact shapes of the dude and poo objects to use in the code. Is there any program you can recommend? I've been trying to figure it out using Gimp.


Top 
 Profile  
Reply with quote  
 Post Posted: January 13th, 2017, 6:23 am 
Site Admin
User avatar

Joined: December 31st, 2011, 4:53 pm
Posts: 3234
Location: Japan
Crop the exact shapes? The tool that turns bmp -> putpixel code just treats one of the colors as transparent and doesn't generate putpixel code for pixels of that color.

_________________
Chili


Top 
 Profile  
Reply with quote  
 Post Posted: January 14th, 2017, 6:56 pm 
 

Joined: January 12th, 2017, 12:28 am
Posts: 18
I'm curious as to what you use to crop the exact image of the dude and poo objects. Do you think you can let me know? I'd appreciate it. Thanks again(:


Top 
 Profile  
Reply with quote  
 Post Posted: January 14th, 2017, 10:39 pm 
 

Joined: February 28th, 2013, 3:23 am
Posts: 2474
Location: Oklahoma, United States
Chili's BMP to PutPixel call program
http://www.planetchili.net/forum/download/file.php?id=5

Lux's Image to PutPixel call program
http://www.planetchili.net/forum/downlo ... php?id=148

_________________
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com


Top 
 Profile  
Reply with quote  
 Post Posted: January 15th, 2017, 11:47 pm 
 

Joined: January 12th, 2017, 12:28 am
Posts: 18
Ah, thanks. Sorry, I didn't realize i posted that twice. I'll try it out (:


Top 
 Profile  
Reply with quote  
 Post Posted: January 18th, 2017, 6:56 am 
 

Joined: January 12th, 2017, 12:28 am
Posts: 18
I understand the first portion of the tutorial, where you have to create the board class and all,
but when you start mentioning delta_loc and create all those other functions, I'm lost again around 23:00

Sorry if that's not very specific, I'm just lost at that exact point and everything after that doesn't make sense to me. It's a bit difficult to understand the logic and what's going on.


Top 
 Profile  
Reply with quote  
 Post Posted: January 19th, 2017, 8:39 am 
Site Admin
User avatar

Joined: December 31st, 2011, 4:53 pm
Posts: 3234
Location: Japan
Blood wrote:
I understand the first portion of the tutorial, where you have to create the board class and all,
but when you start mentioning delta_loc and create all those other functions, I'm lost again around 23:00

Sorry if that's not very specific, I'm just lost at that exact point and everything after that doesn't make sense to me. It's a bit difficult to understand the logic and what's going on.


Hmmm, well let's break it down then.

First, do you understand the idea of combining the grid coordinates (x,y) into a single data type (struct Location) and storing and using them as a single unit thereby?

_________________
Chili


Top 
 Profile  
Reply with quote  
 Post Posted: January 19th, 2017, 10:39 am 
 

Joined: January 12th, 2017, 12:28 am
Posts: 18
Yeah, I believe so.

It's basically just using different functions to generate the individual pixels to form the rectangles, where the values of loc.x and loc.y would use some algorithmns to be translated into the start coordinates of where the rectangles should be drawn on the screen, and the dimensions are used to determine when the rectangles should stop drawing. We combine them by iterating over a loop which initializes a location object, passing the new values of x and y to the constructor , thereby allowing us to simply pass in the location object as opposed to passing in x and y all the time.

Correct me if I'm wrong? :D Thank you for helping


Top 
 Profile  
Reply with quote  
 Post Posted: January 20th, 2017, 3:29 am 
Site Admin
User avatar

Joined: December 31st, 2011, 4:53 pm
Posts: 3234
Location: Japan
Alright, I see one issue to start with. It is not fruitful to think about Location data in terms of rectangles or pixels. Location has nothing to do with these things. Location represent the grid position in game space, in the pure world of our simulation, and is not tied to any particular graphical representation. The graphical aspect is handled by the Board class, which takes grid coordinates (Locations) and translates them into rectangles formed of pixels.

For example, I could port the Snek game so that it would be played in a text terminal, rather than in a window client region rendered with Direct3D. In that case, the ideas of rectangles and pixels would not apply, but he ideas of Location--ideas about the grid coordinates in the simulation world--would not be affected at all. I need only change the Board class, and I can have the same game run the exact same way, but this time in a console.

Does this make sense? Also, do you still need help with delta_loc concepts?

_________________
Chili


Top 
 Profile  
Reply with quote  
 Post Posted: January 21st, 2017, 3:26 am 
 

Joined: January 12th, 2017, 12:28 am
Posts: 18
Thanks for that explanation (:
And yeah, I'm still a bit confused on how the movement of the segments occur.
You stated that they need to follow the proceeding segment in order, starting from the tail.


Top 
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 49 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

Board index » Everything


 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron