GLBasic forum

Main forum => GLBasic - en => Topic started by: Hb! on 2007-Sep-17

Title: How do i make a sprite sequence?
Post by: Hb! on 2007-Sep-17
I mean how do you make visible an sprite in 100, 100  and then ya make appear a new one in the same position? (obviously  deleting the last one XD)  i thought... umm maybe... killfile.... but i think it doesnt work .... or does it? and how do you make a health bar? yes i know ive read that question in here before.. but how do you give values to it?  that each time a character(for example) recieves damage the color in the health bar decreases... how do you?
Title: How do i make a sprite sequence?
Post by: Kitty Hello on 2007-Sep-18
See the "First Game" demo video in the FAQ section.
Title: How do i make a sprite sequence?
Post by: Hb! on 2007-Sep-18
ok thanks.... ill buy a "basic" book so i wont bother so frecuently XD
Title: How do i make a sprite sequence?
Post by: Kitty Hello on 2007-Sep-19
nah, that's perfectly OK. just read the tutorials in the Manual (F1 in editor.)
Title: How do i make a sprite sequence?
Post by: Hb! on 2007-Sep-19
ive been reading tutorials in the manual... thats how i made the little things i can make.... but disgratefully im sort kinda stupid thats  why i havent done nothing outstanding yet,,, ~~ like right now ... i wasnt able to  make that sequence.. why? cause i couldnt understand the basic structure of  " my first game" tsk i ve tried all day long.. and i got no results... (i mean i could have copied the code entirely or simply replace the sprites... but that way id have gotten more confused and ignoring how to create my own sequence am i right?) tsk im certainly a baka ( baka means idiot in japanese....)
Title: How do i make a sprite sequence?
Post by: Moru on 2007-Sep-19
Did you learn to program basic before you started with GL-Basic? I think a little basic knowledge is good before you start with games, saves you a lot of troubles.

The tutorials isn't commented as good as they could be for a basic newbie, they seem more intended on people that already knows basic fairly well. Look up a tutorial on google, most of them should be possible to do on GL-Basic with some smaller changes. For example the print command needs the positions on the screen, that is usualy not needed on other basics.

Good luck!
Title: How do i make a sprite sequence?
Post by: Kitty Hello on 2007-Sep-19
Nah. Just do this:
First, copy/paste the code. Get it working. Then look up the reference for each command from to to bottom in the manual to understand what it does.
When you finally get the grip, try alternating the code.
Implement a 2nd enemy or let the player move left/right. Just tiny modifications. That's the way to learn programming. In my age, we had computer magazines, that printed listings of BASIC code games. And everytime they had a bug in the listing, which got corrected in the next issue (what an coincidence, huh!?).
So, we started tracking the bugs ourselfes. One day, ou were so good, you knew how to program, although you never wrote a single program so far.
Title: How do i make a sprite sequence?
Post by: Hb! on 2007-Sep-20
yop thats why i brought that book about basic...yes  i think ill have to read that book and the manual as well althought that ive been reading it everyday.... i understand the functions.... but sometimes  i dont understand how come some ecuations work... anyways ill read that book .....
Title: How do i make a sprite sequence?
Post by: Kitty Hello on 2007-Sep-20
If you don't understand something, please post here. I'm happy to get advice where to improve the manual.
Title: How do i make a sprite sequence?
Post by: Kitty Hello on 2007-Sep-22
Thank you. Notice, SPRITE is replaced by DRAWSPRITE with Version 5.x, though.
Title: How do i make a sprite sequence?
Post by: Hb! on 2007-Oct-22
Look at this (just in case that some one that has merely downloaded Glbasic sees this post... )
Code (glbasic) Select
FOR a=0 TO 19

DRAWSPRITE a, -20, 255
SHOWSCREEN
NEXT
b=255

WHILE TRUE
IF KEY(200)
DEC b, 10
DRAWSPRITE 20, -20, b
 
ELSE
DRAWSPRITE 19, -20, 255
ENDIF
SHOWSCREEN
WEND
its the advance I have taken since I discovered that thing of the "FOR TO" command.... so what do you think its better than the last one (the one with a bug by the way, and yes this one doesn't cause an error ) isn't it?
Title: How do i make a sprite sequence?
Post by: rajkarthy on 2007-Dec-01
Quote
hi am a beginner in GL basic, ive following doubts:
1. whether  only GL syntax should be used ? and not others  like C++,etc... ?
2.where can i find complete references other than the manual ?
plz help
Title: How do i make a sprite sequence?
Post by: Schranz0r on 2007-Dec-01
Hi rajkarthy

You can only use the manual (F1) / reference A-Z
Title: How do i make a sprite sequence?
Post by: Kitty Hello on 2007-Dec-01
And yes, using C++ inline calls should not be required for you. If there's some extension needen, we do it for you.
Title: How do i make a sprite sequence?
Post by: bigsofty on 2007-Dec-01
GLBasic is "highlevel" language, this means that complicated c++, openGL commands that are usually required for graphical program to work on the PC for example are 'hidden' within the GLBasic language itself.

So for example, it could take 15 lines of C++ and OpenGL commands to check the hardware and O.S. to then open a OpenGL window. But in GLBasic this can be done in one simple command, all the complications are 'under the bonnet' so to speak.

This allows the beginner to start quickly, without having to become an OpenGL API and C++ expert before getting started in the world of games programming.

When and if you want to go 'advanced' and insert your own C++ or OpenGL commands, GLBasic is flexible enough to allow this BUT ITS NOT REQUIRED. Advanced programming techniques can easily be archived with GLBasic alone.
Title: How do i make a sprite sequence?
Post by: Hb! on 2007-Dec-11
Hi, I just want to post this animation, in this case instead of behaving as an endless loop, this animation appears and then stops once the last sprite is shown, anyway, I still need to improve it here you go criticize it as much as you can, ^^ I need to improve more... and by the way what do you think about it? is it good? or needs more improvement?
Code (glbasic) Select
main:
FOR a=1 TO 11
IF KEY(30)
DRAWSPRITE a, 200, 200
ELSE
DRAWSPRITE 1, 200, 200
ENDIF
SHOWSCREEN
NEXT
KEYWAIT
GOTO main
Title: How do i make a sprite sequence?
Post by: Kitty Hello on 2007-Dec-11
for 2 animatinos, ok. But for more, use an array.
Title: How do i make a sprite sequence?
Post by: bigsofty on 2007-Dec-11
See here...

http://www.glbasic.com/forum/viewtopic.php?id=1253

...not the best, but readable...