18 March 2011, 16:12 | #1 |
it's all in your head
Join Date: Feb 2011
Location: The Netherlands
Posts: 174
|
Coding my game in Blitz2
I've started coding a game in Blitz Basic 2. This is my very first Blitz program, so I'm still getting used to how things are done.
So, I have a question: I've pixeld a little red wizard. Now I'd want to make it walk on the screen with the keyboard. The walking (and jumping) animations look like this: My problem: how do I load the image into memory and make it walk around? I think I should LoadShape a brush, then blit it on screen? Last edited by r0ber7; 18 March 2011 at 17:13. |
18 March 2011, 17:36 | #2 |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
From memory you need to create a shape using an external program (try aminet, or SHED in the archive I upped),and then blit it as you say. I cannot remember off the top of my head, it's a bit hazy..
Check through that stuff I upped |
18 March 2011, 18:07 | #3 |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
Okay I have had another look (I actually loaded Blitz ) and you do need to create shapes, then you simply blitz them
There is an example in the examples directory that blits some basic shapes. It also creates a Slice which is basically a screen! The slice format is Code:
Slice [Slice#,Y,Flags]|[Slice#,Y,Width,Hite,Flgs,Bitplns,Sprts,Colrs,Fscrnw,Bscrnw] |
18 March 2011, 18:14 | #4 |
AMOS Extensions Developer
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
|
|
21 March 2011, 17:41 | #5 | |
it's all in your head
Join Date: Feb 2011
Location: The Netherlands
Posts: 174
|
Quote:
I'm now trying to set up a 320x256 slice with 256 colours. Is this even possible? Or should I edit my images? When not run in Blitz mode, 256 colour bitmap + shapes blitted on it works perfectly, but in Blitz mode it tells me "too many bitplanes to load". Perhaps blitz mode is not for AGA? I'm considering not making it an AGA game... The idea is to have an animated shape (smoking wizard) on a bitmap (home.iff). Thanks, here's another: Last edited by r0ber7; 21 March 2011 at 18:11. |
|
21 March 2011, 17:46 | #6 |
HOL/FTP busy bee
Join Date: Sep 2006
Location: Germany
Age: 46
Posts: 31,679
|
|
21 March 2011, 18:16 | #7 |
95th User
Join Date: May 2001
Location: Brighton/UK
Age: 48
Posts: 3,120
|
nice... what kinda game is it... platform adventure?
|
21 March 2011, 18:25 | #8 |
Registered User
Join Date: Mar 2005
Location: London UK
Posts: 1,532
|
this is nice
|
21 March 2011, 19:40 | #9 | |
Moderator
Join Date: Jul 2004
Location: Norwich, Norfolk, UK
Age: 37
Posts: 11,167
|
Quote:
Nice graphics - good luck and if you need any help give me a shout - I used to code in Blitz quite a lot myself but haven't done much for a few years. I'm looking to get back into it very soon though |
|
21 March 2011, 19:53 | #10 |
it's all in your head
Join Date: Feb 2011
Location: The Netherlands
Posts: 174
|
I was thinking along those lines, yeah. How it will exactly turn out remains to be seen.
Found the lib, reading up on it now. |
22 March 2011, 14:50 | #11 |
it's all in your head
Join Date: Feb 2011
Location: The Netherlands
Posts: 174
|
Ok, I've got the smoking wizard figured out in Blitz mode, 256 colours.
Next stop: Key input -> walking wizard around with arrow keys. Simple enough, I use RawStatus() to check for key input and change the wizard's position and animation according to which way we're walking/jumping. But! I face an obstacle: RawStatus() requires the raw key code to check if a key is being pressed. I've been looking around for a key code reference, but can't find it. I can't figure out which key codes are used for the arrow keys, so if anyone knows of a keycode reference, let me know. The examples dir contains an example to check for the F1 key, but I don't wanna use the F-keys to walk around! |
22 March 2011, 14:57 | #12 |
Lesser Talent
Join Date: Jan 2003
Location: UK
Age: 42
Posts: 7,957
|
|
22 March 2011, 15:01 | #13 |
it's all in your head
Join Date: Feb 2011
Location: The Netherlands
Posts: 174
|
Nice! Thanks for the quick reply, I'm off to get started on world 1.
Edit: I've got the little guy walking around, and jumping quite realistically. Last edited by r0ber7; 22 March 2011 at 18:04. |
22 March 2011, 23:02 | #14 |
I Identify as an Ewok
Join Date: Jul 2001
Location: North Lincolnshire
Age: 45
Posts: 2,356
|
|
23 March 2011, 01:22 | #15 |
it's all in your head
Join Date: Feb 2011
Location: The Netherlands
Posts: 174
|
Here's the first basic setup for a world:
[ Show youtube player ] |
23 March 2011, 11:37 | #16 |
95th User
Join Date: May 2001
Location: Brighton/UK
Age: 48
Posts: 3,120
|
Looking good.. If you looking for someone to help out with testing on both winuae and real A1200 drop me a pm I would be happy to help
Sometime ago I was thinking of creating a similar game which featured a wizard that had to beat bosses by collecting items froms baddies and through solving puzzles.. The bosses physically blocked your advancement to the next part of the level... |
23 March 2011, 18:50 | #17 |
AMOS Extensions Developer
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
|
Cool video and, as you previously stated, he is jumping realistically. Good to see you living the old coding spirit - working til all hours of the night (1:15am)
Regards, Lonewolf10 |
24 March 2011, 08:31 | #18 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Checked out the vid - it looks really nice!
From no Blitz coding experience to this in a few days is excellent work and just goes to prove that the best way to learn to code is to think of something you'd like to code and just get on and code it! Looking forward to seeing more progress on this and playing the finished game too. |
24 March 2011, 12:21 | #19 | |||
it's all in your head
Join Date: Feb 2011
Location: The Netherlands
Posts: 174
|
Thanks for the comments. Really fun doing pixely stuff on Amiga again.
Quote:
Quote:
Quote:
To be fair, I'd already coded a setup for a similar game (same wizard sprites) in C/C++ on linux with OpenGL. OpenGL being a 3d engine, it provided me with nice "depth" in the background scrolling, but the pixeled wizard came out looking rather bad. Blitz2 is much easier to learn than OpenGL, and the concepts are the same. There's still a lot to learn however. I lost the C code due to a corrupt partition. Glad I saved the sprites though! To the Blitz coders around here: Right now, first I build a bitmap for the world like this: Code:
LoadShape 0, "dh3:iff/world1/w1-1.iff",1 LoadShape 1, "dh3:iff/world1/w1-2.iff" LoadShape 2, "dh3:iff/world1/w1-3.iff" Use BitMap 1 Blit 0,0,0 Blit 1,320,0 Blit 2,640,0 Code:
; right arrow key If RawStatus(78) UnBuffer 0 x=x+2 BBlit 0,i,140+x,y Code:
DisplayBitMap 1,1,x,0 VWait Edit: I think double buffering might solve this... Still, I wonder what's more efficient: bblitting every shape on the bitmap or using sprites? Last edited by r0ber7; 24 March 2011 at 15:56. |
|||
24 March 2011, 18:36 | #20 |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
Sprites are more efficient but have constraints (number colours, width etc).. It is worth experimenting with both i suppose and double buffering may be beneficial
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Blitz2: Hires laced | BippyM | Coders. Language | 25 | 06 February 2020 01:07 |
Blitz2 keyboard issues | htdreams | Coders. Blitz Basic | 2 | 16 August 2013 15:58 |
Blitz2 Newcommandset | BippyM | Coders. Language | 0 | 21 July 2012 23:59 |
Blitz2 Manual | AlfaRomeo | Amiga scene | 18 | 01 May 2009 10:53 |
Embed data in Blitz2 programs | oRBIT | Coders. General | 25 | 06 April 2007 19:49 |
|
|