Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Newbie Questions
by AndrewAMD. 12/04/23 11:14
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
4 registered members (TipmyPip, Quad, alibaba, izorro), 545 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Creating an pong game #187343
03/06/08 21:24
03/06/08 21:24
Joined: Mar 2008
Posts: 3
C
calsmurf Offline OP
Guest
calsmurf  Offline OP
Guest
C

Joined: Mar 2008
Posts: 3
Hello,
I started with gamestudio a couple of days ago and followed some tutorials.
I am trying to make an pong game.
I have read in the manuel that supported formats for ent_create are bmp etc.
however i have an bmp file and it says bad file format.
This is my code so far :
Code:

#include <default.c>
#include <acknex.h>
ENTITY* pong1;
action firstpong(){
while(1){
my.x += 1; //These codes are for testing purposes
my.y += 1;
wait (1);
}
}
function main(){
level_load(null); //Creating an empty level for the entity
wait (2); //Waiting for the level to load
pong1 = ent_create("Images/pong.bmp",vector(100,100,null),firstpong); // z is null at vector because i am not making an 3D game.
}



does anyone knows what is wrong ??

Re: Creating an pong game [Re: calsmurf] #187344
03/06/08 21:34
03/06/08 21:34
Joined: Mar 2008
Posts: 3
C
calsmurf Offline OP
Guest
calsmurf  Offline OP
Guest
C

Joined: Mar 2008
Posts: 3
srry for dubbelpost
i have changed the path to pong.bmp instead of Images/pong.bmp and now its working however the entity is not visible....does someone knows how to make it visible ?

Re: Creating an pong game [Re: calsmurf] #187345
03/09/08 10:46
03/09/08 10:46
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
If you make a 2d Game, you have to work with PANELS* Code:
 

PANEL* your_pan =
{
bmap = your_bmap;
layer = 1;
pos_x = 20;
pos_y = 50;
flags = VISIBLE;
}


have a look at the manual and make the lite-c Tutorial, there you learn a lot of Panels

Re: Creating an pong game [Re: Widi] #187346
03/10/08 16:45
03/10/08 16:45
Joined: Mar 2008
Posts: 3
C
calsmurf Offline OP
Guest
calsmurf  Offline OP
Guest
C

Joined: Mar 2008
Posts: 3
i wanted the pong to move...and i couldn't do this with panels.
but nvm i have fixed it by changing the coordinates of the entity.
Does anyone know how to move the pong ball and do collision with the pongs ?

Re: Creating an pong game [Re: calsmurf] #187347
03/10/08 17:40
03/10/08 17:40
Joined: Jan 2006
Posts: 53
New Jersey, USA
J
jimc74 Offline
Junior Member
jimc74  Offline
Junior Member
J

Joined: Jan 2006
Posts: 53
New Jersey, USA
if abs(your_pan.x - ballposition_pan.x) < 20
// or
if abs(your_pan.pos_x - ballposition_pan.x) < 20
// can't remember which.

this is the
distance formula.
I don't know if there is a collision routine
for panels.


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1