Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - expleo

Pages: 1 [2] 3 4
16
Game Programming / Re: Encounter system
« on: February 05, 2014, 12:35:59 am »
Well, you should define your container with the elements you want, enemy image, healthbars, combat action buttons etc, and hide the container with containersetvisible.

Then when the player enters the spot you want the encounter to take place, you use again containersetvisible, and perhaps also disable the 'walking' view. It is all about showing and hiding the containers.

17
Game Programming / Re: Encounter system
« on: February 04, 2014, 03:15:50 pm »
I guess the encounter system is the easiest part of such game. The encounter itself is random, based on an algirithm.. The more you walk, the greater the chance.  The combat itself is s container with images and buttons, I am a bit unshure what exactly is your question.

18
DragonFireSDK Spotlight / lich tower of doom, hopfully soon in appstore :)
« on: February 04, 2014, 12:15:42 am »
sent final build last night, so we can also use as a check to see how long it takes before submitted, reviewed and hopfully approved. my game is a kind of rougelike, I have spent hundreds if not thousand hours building and testing.

game has 1700 graphical elements, 200 frames of player animation, 500 frames of enemy animations, custom commisioned soundtrack and hand drawn art.

wish me luck, this one actualy cost a bit of money to develop, not counting  the time I spent myself.

webpage at http://www.lichtowerofdoom.com

19
Game Programming / Re: always lose
« on: February 03, 2014, 05:37:16 am »
Hi, I don't quite understand what you mean, but I Notice 2 other issues with your app:

one is that you have used for image reference images/ and also Images (capital and lowercase i/I). Now, for this to work on the device, this is case sensitive. So if your folder is called Images, you must use "Images" in your code (capital I). Simulator will show image regardless, but on device it will not. I have spent many hours griefing over this myself :D

so, the other issue you might or might not have. I see you use a random number. Without using the Randomizer(); function, random will create the same string of numbers every time you play. To use Randomize();, put it under main(){ and also at top have

#include <time.h>

(same place include <dragonfiresdk.h> is

This might or might not solver your issue, but at least it will take a few steps closer to working as intended.

20
How Do I...? / Re: How can I display random images in background?
« on: February 03, 2014, 05:18:20 am »
Hi, file names can be numbers :)

So I would name them 1.png, 2.png etc etc for simplicity.

But, what you probalby mean is that filenames cannot be integer values, and this is correct. So what you must do is to 'cast' (it is called casting when you transform one variable type into another) the random number you have generated into a char.
   
      int myRandomValue=random(10)+1;  //this will generate a number between 1-10
   char FileName[150];
   StrCopy(FileName,"Images/myImages/");
   StrAppend(FileName,("%d",myRandomValue));
   StrAppend(FileName, ".png");
ImageSetImage(randomImage,FileName);

What we do with this code is create a string that can be used to load the filename. If for example random number here is 4, the abowe will create something that would be the same as typing:

ImageSetImage(randomImage,"/Images/myImages/4.png");

The trick here is to convert the random number 4 into char, and put it after "/Images [..] and before the .png"

and we do this with StrAppend(FileName,("%d",myRandomValue));

with strappend we ADD to the stringvalue we are building. The %d will take the next variable from type Int (the myrandomvalue) and put it in as a char.

21
How Do I...? / Re: Slow down an object scroll
« on: January 31, 2014, 09:13:54 am »
The onTimer is called 30 times a seccond. To 'slow down' you need a countervariable. For example, I have the following code to play a torch on a wall animation, that changes image every 3'd 'on timer' cycle instead of 'every':

   if (torchAnimWait==3){
      ViewSetImage(torchItemView,torchItem[torchanimation]);
      ViewSetImage(torchItemView2,torchItem[torchanimation]);
      torchanimation++;
      if (torchanimation>=4){torchanimation=0;}
      
   }
   torchAnimWait++;

   if (torchAnimWait>3){
      torchAnimWait=0;
   }

The torchanimation equals the variable you are using to move your object, but my torchanimwait is the 'counter' I use to reduce the speed.

If I set

if (torchAnimWait>30){ (30 instead of 3)
the torch animation will play with 1 frame a seccond (perhaps a bit too slow for a flame :), as it stands now, it is 30/3= 10 frames per seccond. The first IF just changes the image, and my

if (torchanimation>=4){torchanimation=0;}

is resetting the imagearray, as I have 4 frames total.

I would probalby use a switch instead if I coded this today.


22
Game Programming / Re: ViewAdd vs ButtonAdd == Same?
« on: January 31, 2014, 09:04:49 am »
The buttonAdd actualy creates a viewadd with two images associated and a touchstate that updates what image is shown.

You can create a view, then have an on-touch check that uses a viewsetimage, but easier to use buttonadd to create a button-like feature.

23
Game Programming / Re: always lose
« on: January 31, 2014, 08:57:59 am »
Hi, I didnt study your code in-deptht, but I noticed at least one problem area (repeated several places).

You have an if statement that says if(turn=false), this is wrong. A singler = is used to assign a value to a variable, like in turn=false;, but if you want to check the value you must do a double == as in

if (turn==false){
}

so start by fix that.

24
How Do I...? / Re: Adding and placing objects by touch
« on: January 24, 2014, 01:56:36 am »
Hi, the API is not that bad documentation, but it takes a few tries before you get the hang of it (and how to use it).

I dont think my post was very much informative, but the API calls you need to read up on is:

ImageAdd
ViewAdd
ViewSetVisible
TouchAdd

with those 4 API calls you can do what you want to do with this image

25
How Do I...? / Re: Adding and placing objects by touch
« on: January 22, 2014, 01:04:00 am »
Hi, what you would need to do is have the object (lets say an image ?) created already (in main or in a loadImages() function). You will need to have this view hidden until 'needed'.

Then you need to define the touch area (TouchAdd) , for example:

TouchAdd(0, 0,240, 240 OnTouchItem, 1);

this will create a touch area, when touched it will trigger the 'ontouchitem' routine, with parameter '1'

Remember to declare the touchitem: int OnTouchItem(int id, int event, int x, int y);

Now you need to code the function

int OnTouchItem(int id, int event, int x, int y) {    //event: 1=down, 2=move, 3=up
if (event==3){ // touch and release, per API doc
switch (id){ // id is passed from the touch.
case 1: // 1 is the item we pased form the touch add
[..] code here the getxy for touch, setview of your view and show the view.
break;
}
}
}

Something like that :)

26
Non-Game Programming / Re: TextSetText is not working for me!
« on: January 20, 2014, 04:26:52 am »
Hello, just browsing your code:

TextSetText(text3, text2);

With this line, you say you want the content of variable text2 into the variable text3.

You have though defined text 3 as a text object, not the actual text:

text3 = TextAdd(50, 80, "adsjjeje", font);

What you want is:

declarations:

int myNumberofClicks;  // your counter for number of clicks
char text_myNumberofClicks[10]; // this will be used to transform the INT variable myNumber into a char that can be printed
int myTextObject; //the text instance you want to use.

main:

myTextObject=TextAdd(50,80,"           ",font); //we leave some blanks so we dont get a buffer issue

and on the onbutton:

sprintf (text_myNumberofClicks,"%d",myNumberofClicks); // here we put the integer value from count into char that can be printed
TextSetText(myTextObject,text_myNumberofClicks); // here we put the now 'casted' value from count to the char variable myNumberofClicks, and put it to be displayer by the text object  'myTextObject'.



There are 2 things we can learn from this:

1- to print integer values, you need to typecast them into char (use sprintf)

and

2- learn what is a variable, and what is an object. You will come across similar issues later, where you have an int IMAGE, and then an int IMAGEVIEW. The imageview shows the image, but the variable IMAGE holds 'what' image to show.

I didnt test the code I wrote there, so might be some errors, let me know if I fail to explain well enough how to solve it :)

27
DragonFireSDK Spotlight / Re: Firefly game now on App Store
« on: January 18, 2014, 02:42:56 am »
Not bad at all, first scroller shooter I have played from dragonfire sdk.

Couple of notes though: One time the dragon was right on top of the powerup without getting the powerup. I guess I had passed the 'head'.
Also the name of the game could have been more researched. wehen searching for firefly on appstore, this game dont show up at all, but a zillion other firefly games.
I also think it could be beneficial to be a universal build.

And lastly, even I think it was a fun game to try out, I don't think it will be a app-killer :) But then again, in the same boat as rest of us hehe.

28
DragonFireSDK Spotlight / Re: Firefly game now on App Store
« on: January 17, 2014, 02:01:41 pm »
I'll purchase it and give it a shot when Im hitting the bed today :)

29
App Store / Re: How you get revenues from App Store
« on: September 30, 2013, 07:05:35 am »
Hi.

1) get developer account (100$)
2) Enroll in dev program, digitaly sign a bunch of apple contracts, enter bank/taxstatement etc
3) Upload the app the normal way, set your price tag


So its not much more to it than that, except the old saying''

"How you get revenues from App Store" - answer: you don't.

Unless you have a solid product and it gets a lot of attention, you wont see much revenue. In my humble opinion, todays market is either 'you do it big' or 'you dont do it at all'. Has a lot to do with visibility. Apps that 'do it' gets visible, so players buy them, and on and on it goes.

30
DragonFireSDK Spotlight / Re: Shave Ice Tycoon
« on: August 31, 2013, 12:24:31 pm »
real neet with the animatet dues running around :)

Pages: 1 [2] 3 4